+ Start a Discussion
lisa@limao.com.brlisa@limao.com.br 

About : email unsubscribe / opt out 



Hello!

 

I read in the Help Using the object InboundEmail / Example 2: Administering mail being entered:: Managing email not entered Companies that send marketing emails to customers and prospects need to have a way for recipients to unsubscribe. The following is an example of how an e-mail service can process requests for cancellation of registration. The code looks in the subject line of incoming e-mail the word "unsubscribe". If the word is found, the code will find all the contacts and leads that match the email address and define the field Refusal mail (HasOptedOutOfEmail) True.

 

But not understand how to apply. I need put the HTML in the email?

please, give an example in the text email, how should I do?

 

my business email is : lisangela.chiarelli@fretemania.com.br and my personal : lisa@limao.com.br

sfdcfoxsfdcfox

I personally would use an unsubscribe Sites page. I wrote one of these once; it takes only about an hour with test code. At that point, you can create an unsubscribe link, such as "<domainname>/unsubscribe?email=...". This is an easy way to make an easily available page (using Visualforce) that can quickly unsubscribe all contacts and leads that match an email address. You don't need to place any HTML at all on the email, unless you're doing HTML emails and you want the link to be clickable.

 

The method they described would have you use an Inbound Email handler to handle the unsubscribe requests. The "code" you see in the examples are not HTML, they are Apex Code or Visualforce. To use these code samples, you need to have a Developer or Sandbox account. If your current login is a Developer login (your browser's title bar reads "Developer Edition"), you can simply log in to your organization, click on Setup > Develop > Apex Classes, and put the code in a new class. If you used your live edition (the title bar reads "Professional Edition", "Enterprise Edition", etc), then you need a Sandbox, which is found under Setup > Data Management > Sandboxes. There is no code at all you need to place into the email: simply state that if they wish to unsubscribe, they just need to click reply, type "unsubscribe" in the subject, and click Send.

 

Once the email is received by salesforce.com's servers, it will be processed by your code and the result will be that the contacts/leads with the given email address will be marked as unsubscribed.

Gabriel FarahGabriel Farah

Hi @sfdcfox, by any chance do you still have the code to do this:

"...you can create an unsubscribe link, such as "<domainname>/unsubscribe?email=...". This is an easy way to make an easily available page (using Visualforce) that can quickly unsubscribe all contacts and leads that match an email address. You don't need to place any HTML at all on the email, unless you're doing HTML emails and you want the link to be clickable." 

thanks!