in implementation guides ~ read.
Servlet3

Servlet3

DOWNLOAD

First things first !
To download this implementation guide, click the download button below.
If you need more information about the implementation guide, you can read the Table of Contents below.

Download

ForcecomEmailServicesUnsubscribeOptoutApexCode
Mostcompaniessendoutmarketingemailstotheircustomersand
prospectsandneedawaytoletthemunsubscribefromyouremail
messagesThissamplecodeshowshowyoucanwriteForcecomEmail
Servicestoprocessunsubscriberequestsfromtheemailrecipients

Thecodewillsearchinthesubjectlineforthewordunsubscribe
IfthewordisfoundallcontactswhomatchesthefromEmail
AddresswillbeupdatedwithHasOptedOutOfEmailtrue
ThecodewillsearchthroughtheLeadsandupdatethe
HasOptedOutOfEmailfieldtotrueforthesameemailaddresses
Thecodethenreturnstrueandexist
Howtoinstallandconfiguretheemailunsubscribefunctionality
CreatetheNewEmailService

Pageof

InstallthepackagefromAppExchange
AfteritisinstalledgotoSetupAppSetupDevelopApex
ClassesandtakealookattheApexCode
Navigateto
a SetupAppSetupDevelopEmailServices
ClickNewEmailService
NametheEmailService
LookupandselecttheApexClassUnsubscribe
SelectIfyouwanttoacceptemailattachments

a IrecommendtosetittoNoneforthisEmailService

ChooseifyouwanttolimittheaccessbyturningonAdvancedEmail
Securityandonlyacceptemailsfromcertaindomainsandoremail
addresses
ChooseyoursettingsforFailureResponses

a IrecommendsettingthemtoDiscardforallexcepttheOver

EmailRateLimitIwouldsetthattoRequeue

ClickSaveandNewEmailAddress
Createanewemailaddress

Pageof

KeeporchangethenameoftheemailaddressThisisthenamethat
willgoontheleftsideofthesign
MakesureyoucheckitasActive
Contextuseristhesalesforcecomuserthatwillberecordedas
havingupdatedthecontactorleadrecordasunsubscribed
KeeptheAcceptEmailFromfieldblankifyouwanttoallowanyof
yourcontactsorleadstounsubscribefromanyofyouremails

Addanunsubscribelinktoyourtemplate

Inyouremailtemplatesyoucanaddanunsubscribelink
Makeitamailtolink
a TaketheForcecomEmailServiceemailaddressandadditinto
themailtolink
b Forexampleunsubscribexyzinsalesforcecom
Whenyousendyouremailouttheywillautomaticallyincludethe
unsubscribelinkandallowyourcustomerstounsubscribefromyour
emails

Pageof

Afterinstallingthepackagedothefollowing
GototheApexCode
ClickEditandresaveittomakeisValidcheckboxtrueand
searchable
AddtheEmailOptOutfieldtothepagelayoutofboththecontact
pagelayoutandleadlayout
TheOptOutfieldisnotexposedonthecontactorleadpagelayout
perdefault

Pageof

***