Class: SpreeCmCommissioner::TelegramDebugPinCodeSender
- Inherits:
-
BaseInteractor
- Object
- BaseInteractor
- SpreeCmCommissioner::TelegramDebugPinCodeSender
- Defined in:
- app/interactors/spree_cm_commissioner/telegram_debug_pin_code_sender.rb
Instance Method Summary collapse
Instance Method Details
#body ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'app/interactors/spree_cm_commissioner/telegram_debug_pin_code_sender.rb', line 13 def body text = [] text << "<b>From: #{name}</b>" text << "<b>PIN CODE sent to #{pin_code.contact}</b>" text << "<code>#{pin_code.code}</code> is your #{pin_code.readable_type}" text << "⚠️ Error: <code>#{}<code> ⚠️" if .present? text.compact.join("\n") end |
#call ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/interactors/spree_cm_commissioner/telegram_debug_pin_code_sender.rb', line 5 def call telegram_client.( chat_id: chat_id, parse_mode: 'HTML', text: body ) end |
#chat_id ⇒ Object
24 25 26 |
# File 'app/interactors/spree_cm_commissioner/telegram_debug_pin_code_sender.rb', line 24 def chat_id ENV.fetch('EXCEPTION_NOTIFIER_TELEGRAM_CHANNEL_ID', nil) end |
#telegram_client ⇒ Object
28 29 30 |
# File 'app/interactors/spree_cm_commissioner/telegram_debug_pin_code_sender.rb', line 28 def telegram_client ::Telegram.bots[:exception_notifier] end |