I have a website that currently sends an email to users once they sign up using sendgrid. This works all and well, but I cannot figure out how to do this:
When to user makes a reservation on my website(its kind of like open table), the reservation object is created. I then can go on Active Admin and change the status of the reservation to accepted. When I accept it, I want it to automatically send an email to the user. Does anybody know how I can do this? I've searched through the documentation and I cannot find anything specifically pertaining to Active Admin. I was thinking of it taking an action when the form is submitted aka the reservation status is changed by using sendgrid ruby (https://github.com/sendgrid/sendgrid-ruby). However, I have no idea how to do this. Can someone help me with this?
Thank You!
There wont't be any predefined library for this. You have to call that method which sends the mail after you accept the reservation. under admin/registration.rb, do this:
You have to call the send_mail method after your accept logic or you can use callbacks to invoke send_mail after you accept this registration.