suggested articles / email is now sent
This commit is contained in:
@@ -55,22 +55,21 @@ post '/cart/delivery_destination', &update_delivery_destination
|
||||
|
||||
|
||||
def send_order_email(cart)
|
||||
Pony.options = {
|
||||
:subject => "Nova Narudžba: #{cart.id}",
|
||||
:html_body => "Mušterija naručila nešto. <br /> Pogledati https://www.ribica.ba/backoffice/carts/#{cart.id}",
|
||||
:body => "Mušterija naručila nešto. Pogledati https://www.ribica.ba/backoffice/carts/#{cart.id}",
|
||||
:via => :smtp,
|
||||
:via_options => {
|
||||
:address => 'smtp.gmail.com',
|
||||
:port => '587',
|
||||
:enable_starttls_auto => true,
|
||||
:user_name => 'ribica.ba@gmail.com',
|
||||
:password => 'pumparica*pumpa*sumpa*lumpa',
|
||||
:authentication => :plain, # :plain, :login, :cram_md5, no auth by default
|
||||
:domain => "localhost.localdomain"
|
||||
}
|
||||
}
|
||||
Pony.mail(:to => "narudzbe@ribica.ba")
|
||||
|
||||
client = SendGrid::Client.new(api_user: "ribica",
|
||||
api_key: "plava*kutija*svjetlo*torba07"
|
||||
)
|
||||
|
||||
email = SendGrid::Mail.new do |m|
|
||||
m.to = "narudzbe@ribica.ba"
|
||||
m.from = "draga@ribica.ba"
|
||||
m.from_name = "Prodavnica Ribica"
|
||||
m.subject = "Nova Narudžba: #{cart.id}"
|
||||
m.html = "Mušterija naručila nešto. <br /> Pogledati https://www.ribica.ba/backoffice/carts/#{cart.id}"
|
||||
end
|
||||
|
||||
client.send(email)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user