function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TrondTrond 

Double Opt-In Mail Lists

We have periodic email newsletters that we send out to subscribed contacts and leads. Each newsletter has a checkbox associated with it that determines whether a contact/lead receives the newsletter. We use the HTML Email tool to send the newsletters out based on a query that finds all subscribers with the proper box checked (and the Email Opt-out box not checked)

We're looking for a way to add functions on our client portal and website that would allow us to manage newsletter subscriptions. Subscribe / Unsubscribe / Unsubscribe All, etc. Ideally, we would do a lookup based on the email address and mark the appropriate boxes within salesforce.com. On new subscriptions requested through the website, we need to send a confirmation email out before the box gets checked. Ideally, this email would be associated as an activity (either to the lead or the contact). Once they press a button in the email, they are subscribed for real.

Has anyone done something similar? Does anyone have some sample code that can help me get started on this?

Thanks!
Trond
adamgadamg
I don't know of any sample code for this, but hopefully it won't be to hard. (I assume you want to use Perl.)

If the process is triggered via the salesforce UI (as opposed to a script that gets the request, and fires the confirmation email):

The part I'm not sure about is how to trigger the confirmation email. We don't have a (easy) way of tracking field level changes, which is what you'd require to detect a new intermediate state (ie requested). You could poll for that (ie modified leads/contacts within the past five minutes where opt-in state=requested, and then generate an email with a confirmation code which could in turn confirm the opt-in via a perl cgi.

Two side issues:

1. To avoid sending multiple emails, you need a 4th state (requested-sent).
2. If you want to use a dynamic confirmation code, you'd need to store that code for the user (generated by the email script), and in turn read by the cgi. Perhaps you could store that in a custom field.