Class: Email::V3
- Inherits:
-
Integration
- Object
- Integration
- Email::V3
- Defined in:
- app/models/pager_tree/integrations/email/v3.rb
Constant Summary collapse
- OPTIONS =
[ {key: :allow_spam, type: :boolean, default: false}, {key: :dedup_threads, type: :boolean, default: true} ]
Instance Method Summary collapse
- #adapter_action ⇒ Object
- #adapter_process_create ⇒ Object
- #adapter_should_block? ⇒ Boolean
- #adapter_supports_incoming? ⇒ Boolean
- #adapter_thirdparty_id ⇒ Object
-
#endpoint ⇒ Object
SPECIAL: override integration endpoint.
Instance Method Details
#adapter_action ⇒ Object
49 50 51 |
# File 'app/models/pager_tree/integrations/email/v3.rb', line 49 def adapter_action :create end |
#adapter_process_create ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 |
# File 'app/models/pager_tree/integrations/email/v3.rb', line 53 def adapter_process_create Alert.new( title: _title, description: _description, urgency: urgency, thirdparty_id: _thirdparty_id, dedup_keys: _dedup_keys, additional_data: _additional_datums, attachments: ) end |
#adapter_should_block? ⇒ Boolean
29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/models/pager_tree/integrations/email/v3.rb', line 29 def adapter_should_block? return false if option_allow_spam == true ses_spam_verdict = _get_header("X-SES-Spam-Verdict")&.value if ses_spam_verdict.present? return ses_spam_verdict != "PASS" end false end |
#adapter_supports_incoming? ⇒ Boolean
41 42 43 |
# File 'app/models/pager_tree/integrations/email/v3.rb', line 41 def adapter_supports_incoming? true end |
#adapter_thirdparty_id ⇒ Object
45 46 47 |
# File 'app/models/pager_tree/integrations/email/v3.rb', line 45 def adapter_thirdparty_id _thirdparty_id end |
#endpoint ⇒ Object
SPECIAL: override integration endpoint
18 19 20 21 22 23 24 25 26 27 |
# File 'app/models/pager_tree/integrations/email/v3.rb', line 18 def endpoint domain = ::PagerTree::Integrations.integration_email_v3_domain inbox = ::PagerTree::Integrations.integration_email_v3_inbox postfix = "" postfix = "_stg" if Rails.env.staging? postfix = "_tst" if Rails.env.test? postfix = "_dev" if Rails.env.development? "#{inbox}#{postfix}+#{id}@#{domain}" end |