Class: JellyfishNotification::JellyfishMailer
- Inherits:
-
ActionMailer::Base
- Object
- ActionMailer::Base
- JellyfishNotification::JellyfishMailer
- Defined in:
- lib/jellyfish_notification/jellyfish_mailer.rb
Instance Method Summary collapse
- #publish_order_create(order, recipients, orders_url) ⇒ Object
- #publish_project_approval_update(project, recipients, project_url) ⇒ Object
- #publish_project_create_approvers(response, recipients, projects_url) ⇒ Object
- #publish_project_create_confirmation(response, recipients, projects_url) ⇒ Object
Instance Method Details
#publish_order_create(order, recipients, orders_url) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/jellyfish_notification/jellyfish_mailer.rb', line 31 def publish_order_create(order, recipients, orders_url) @order = order @order_url = orders_url+"/#{@order.id}" recipients = ENV['JELLYFISH_SMTP_DEFAULT_RECIPIENT'] if recipients.empty? mail(template_path: 'jellyfish_mailer', to: recipients, subject: 'Order Create Notification') unless ENV['JELLYFISH_SMTP_DEFAULT_SENDER'].nil? end |
#publish_project_approval_update(project, recipients, project_url) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/jellyfish_notification/jellyfish_mailer.rb', line 23 def publish_project_approval_update(project, recipients, project_url) # format block causes weirdness, so depending on rails conventions so templates resolve @project = project @project_url = project_url recipients = ENV['JELLYFISH_SMTP_DEFAULT_RECIPIENT'] if recipients.empty? mail(template_path: 'jellyfish_mailer', to: recipients, subject: "Project Approval Notification: #{@project.name.to_s.upcase}") unless ENV['JELLYFISH_SMTP_DEFAULT_SENDER'].nil? end |
#publish_project_create_approvers(response, recipients, projects_url) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/jellyfish_notification/jellyfish_mailer.rb', line 7 def publish_project_create_approvers(response, recipients, projects_url) # format block causes weirdness, so depending on rails conventions so templates resolve @project = JSON.parse(response.body).to_h @project_url = projects_url+"/#{@project['id'].to_s}" recipients = ENV['JELLYFISH_SMTP_DEFAULT_RECIPIENT'] if recipients.empty? mail(template_path: 'jellyfish_mailer', to: recipients, subject: "Project Create Notification: #{@project['name'].to_s.upcase}") unless ENV['JELLYFISH_SMTP_DEFAULT_SENDER'].nil? end |
#publish_project_create_confirmation(response, recipients, projects_url) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/jellyfish_notification/jellyfish_mailer.rb', line 15 def publish_project_create_confirmation(response, recipients, projects_url) # format block causes weirdness, so depending on rails conventions so templates resolve @project = JSON.parse(response.body).to_h @project_url = projects_url+"/#{@project['id'].to_s}" recipients = ENV['JELLYFISH_SMTP_DEFAULT_RECIPIENT'] if recipients.empty? mail(template_path: 'jellyfish_mailer', to: recipients, subject: "Project Create Notification: #{@project['name'].to_s.upcase}") unless ENV['JELLYFISH_SMTP_DEFAULT_SENDER'].nil? end |