Class: JellyfishNotification::JellyfishMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/jellyfish_notification/jellyfish_mailer.rb

Instance Method Summary collapse

Instance Method Details

#publish_order_create(order, recipients) ⇒ Object



28
29
30
31
32
33
# File 'lib/jellyfish_notification/jellyfish_mailer.rb', line 28

def publish_order_create(order, recipients)
  @order = order
  @order_url = (Rails.env != 'test') ? (Rails.application.routes.url_helpers.order_url order) : ('http://http://localhost:3000/order-history/' + order.id.to_s)
  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) ⇒ Object



21
22
23
24
25
26
# File 'lib/jellyfish_notification/jellyfish_mailer.rb', line 21

def publish_project_approval_update(project, recipients)
  @project = project
  @project_url = (Rails.env != 'test') ? (Rails.application.routes.url_helpers.project_url project) : ('http://localhost:3000/api/v1/projects/' + project.id.to_s)
  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(project, recipients) ⇒ Object



14
15
16
17
18
19
# File 'lib/jellyfish_notification/jellyfish_mailer.rb', line 14

def publish_project_create_approvers(project, recipients)
  @project = project
  @project_url = (Rails.env != 'test') ? (Rails.application.routes.url_helpers.project_url project) : ('http://localhost:3000/api/v1/projects/' + 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(project, recipients) ⇒ Object



7
8
9
10
11
12
# File 'lib/jellyfish_notification/jellyfish_mailer.rb', line 7

def publish_project_create_confirmation(project, recipients)
  @project = project
  @project_url = (Rails.env != 'test') ? (Rails.application.routes.url_helpers.project_url project) : ('http://localhost:3000/api/v1/projects/' + 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