2

I am using Rails 4 and PHPmyadmin

I designed a form that sends an email with two links, let's call them Link #1 and Link #2.

I need to know if the user that received the email has clicked on link #1 or link #2.

I already have the landing view #1 and view #2 with their corresponding id's, and can access both links.

The end result is that in my list table I need to display the status of every email sent with either:

  • Pending (if user hasn't clicked on any link)
  • Link #1 (if user clicked on it)
  • Link #2 (if user clicked on it)

I know that I need to associate the email id with the view id, but don't know how to do this.

Something like this:

EMAIL.......... LINK CLICKED
[email protected]  pending
[email protected]  Link 1
[email protected]  Link 2

I have found this similar question and this other one, however I don't know how to implement it in my app.

Community
  • 1
  • 1
pochat
  • 33
  • 5

1 Answers1

1

Each link relates to a method in the controller that renders the view.. in your case Link#1 and Link#2 will correspond to some specific action in some controller. You can place checks there against the user you have sent email. Please tell if this helps

noman tayyab
  • 355
  • 3
  • 14
  • Allright, so I did what you said and that worked! I created a controller and a method. Now I am able to save in the database the link id. Now I need to know how to retrieve it, all I'm getting on a link.inspect is the <8883922xhh220>. thanks a lot. – pochat May 03 '14 at 17:26
  • what are you storing and what do you want to retrieve? – noman tayyab May 27 '14 at 13:07