Class: Campagne::Sender

Inherits:
Object
  • Object
show all
Defined in:
app/models/campagne/sender.rb

Class Method Summary collapse

Class Method Details

.deliver_email(email, subject, email_body, token) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/models/campagne/sender.rb', line 5

def self.deliver_email(email, subject, email_body, token)
  sleep 0.5
  ActionMailer::Base::mail({
    :from => "#{Rails.application.config.campagne_from_name} <#{Rails.application.config.campagne_from_email}>",
    :to => email.downcase,
    :subject => subject,
    :body => email_body,
    :content_type => 'text/html; charset=UTF-8',
    :'Return-Path' => "bounce+#{token}@#{Rails.application.config.campagne_domain}",
    :'List-Unsubscribe' => "<mailto:unsubscribe-#{token}@#{Rails.application.config.campagne_domain}>, <#{Rails.application.config.campagne_base_url}/campagne/unsubscribe/#{token}>"
  }).deliver
end