NetTalk Central

Author Topic: HTML Button in Email  (Read 2912 times)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
HTML Button in Email
« on: March 19, 2008, 09:34:15 PM »
I want to add 2 HTML buttons to an email to accept or decline an event

Are there any examples in Nettalk on how to intercept this request and process the event?

Cheers,

Kevin

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: HTML Button in Email
« Reply #1 on: March 20, 2008, 09:17:21 AM »
Of course adding the button in an email is not a problem, right? So what I would do is generate the email's HTML to call the procedure with a parameter. Maybe something like:

button URL to accept invitation:  http://www.yoursite.com/Invite?accept=1

button URL to reject invitation:  http://www.yoursite.com/Invite?accept=0

Then in your procedure, do something like:

  CASE SUB(p_web.wholeurl,1,8)
    OF 'accept = 1'
       ... do the accept stuff...
    OF 'accept = 0
      ... do the reject stuff...
  END !Case

Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: HTML Button in Email
« Reply #2 on: March 21, 2008, 09:36:54 AM »
Hi Kevin,

Mike is right. All you're gonna do is generate a small <form> in your Emails HTM section. The "action" for the form will be a URL of your site. Getting the URL right is important, so something like;

http://www.yoursite.com/response?accept=yes&user=lkhjfgsld8945

Obviously each email you send out has a unique "user" field whatever that is. Typically it's the unique id of the record in the database.

In your procedure, called Response, you can use p_web.GetValue('accept') and so on.

But wait, there's more.

Many email clients no longer allow a Button in an Html email. In other words this approach no longer works. You are allowed a link though, so instead of a <form> with buttons, you use a link.

Cheers
Bruce