vendredi 30 septembre 2016

Email notification from ActionMailer using sendgrid when a user send a new message to another user

New to rails and Stackoverflow. learning the ropes and I'm building an application where I tried using ActionMailer to trigger an email to a user when a message has been sent. The problem is that my code sends a message to the user who wrote the message and not to the recipient.This is my message controller

here's the mailer.rb:

class ConversationMailer < ActionMailer::Base def conversation_created(user) mail(to: user.email, from: "contact@uvesty.com", subject: "You got a beloved message :D", body: "Hi, somebody has messaged you on"

end

end

Aucun commentaire:

Enregistrer un commentaire