Class: SpreeCmCommissioner::VendorCreationTelegramAlertSender
- Inherits:
-
BaseInteractor
- Object
- BaseInteractor
- SpreeCmCommissioner::VendorCreationTelegramAlertSender
- Defined in:
- app/interactors/spree_cm_commissioner/vendor_creation_telegram_alert_sender.rb
Instance Method Summary collapse
Instance Method Details
#admin_chat_id ⇒ Object
24 25 26 |
# File 'app/interactors/spree_cm_commissioner/vendor_creation_telegram_alert_sender.rb', line 24 def admin_chat_id ENV.fetch('EXCEPTION_NOTIFIER_TELEGRAM_CHANNEL_ID', nil) end |
#alert_message ⇒ Object
19 20 21 22 |
# File 'app/interactors/spree_cm_commissioner/vendor_creation_telegram_alert_sender.rb', line 19 def factory = SpreeCmCommissioner::VendorTelegramMessageFactory.new(vendor: vendor) factory. end |
#call ⇒ Object
5 6 7 8 9 |
# File 'app/interactors/spree_cm_commissioner/vendor_creation_telegram_alert_sender.rb', line 5 def call return if admin_chat_id.blank? send_alert end |
#send_alert ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/interactors/spree_cm_commissioner/vendor_creation_telegram_alert_sender.rb', line 11 def send_alert TelegramNotificationSender.call( chat_id: admin_chat_id, message: , parse_mode: 'HTML' ) end |