Rails, How to deliver dynamic email depending on user status after session expiration -


so have website similar e-commerce site. want send out email user after session expiry(preferably 30min after expiry), dynamic content - respect status, i.e. if have items in cart, if haven't paid, or if payment successful.

so there 3 questions here?

  • what different ways achieve this?
  • is possible run section of code after 30min of session expiration?
  • is possible put if-else statement mail delivery depending on user status?

currently, i'm using rails 5.0.0, , sendgrid send emails. sendgrid has codes mail.deliver_after(30 mins). can't seem put if else condition make content of email dynamic. also, want send email after 30 mins after session expiry.

what different ways achieve this?

- using background job. create asynchronous jobs run time , priority. 

is possible run section of code after 30min of session expiration?

- use delayed_job gem or use other background job gems. using asynchronously 

is possible put if-else statement mail delivery depending on user status?

 - called mail delivery using background job can send mail whenever want.  

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -