0

I have ExactTarget for Salesforce enabled and I'd like to create a Task record whenever someone clicks on a particular link in my email template.

I am aware that AMPscript allows me to create a record in SFDC through 'CreateSalesforceObject' and wanted to know if there was a way to trigger such code through clicking a 'Meet Rep' link in my email.

My AMPscript code as of now (I am aware this is static, but I'm using this for testing purposes):

%%[ var @id set @id=CreateSalesforceObject("task", 3, "WhoId","003w0000018b98p","Subject", "A Customer Has Requested a Rep Meeting", "Owner", "00520000001Vp3O", "Description", "A customer has requested a meeting with a Rep"))]%%

Basically, I send email -> client receives email -> client clicks 'meet rep' link on email -> AMPscript is triggered -> Task Record is created in SFDC

Is it possible to make this happen? If so what code do I need to add to my HTML email template as to trigger the AMPscript? Can anyone provide a pointer to how this can be written?

Thank you for your time and I'm extremely grateful for any help!

Cory Danielson
  • 14,314
  • 3
  • 44
  • 51
slovak_100
  • 782
  • 2
  • 10
  • 33

2 Answers2

2

I don't believe you can attach AMPScript to links that way. You'll need to have an intermediate ET landing page that accepts the subscriber data and then executes the CreateSalesforceObject() function. All of the subscriber personalization strings would be available to you on the landing page if you link to it using the MicrositeURL() in your email.

You didn't mention what you wanted to occur when someone clicks on the link. Some kind of confirmation message on a landing page seems appropriate.

Landing Pages

Microsite/Landing Page AMPScript Functions

Adam Spriggs
  • 626
  • 8
  • 23
0

You can create a cloud page with that ampscript and insert a link to that page in your email.

The cloud page consist of some basic html saying "Thank you", so each time a customer visits the page a task will be created. You can also use cookies to disable multiple tasks created by the same user.

Here is an example:

%%[
  var @visited
  var @id

set @cookieName = 'ZSfreecheck' 
set @subject = HTTPRequestHeader("Cookie")
set @pattern = Concat(@cookieName, '=(.*?)(;\s|$)') 
set @cookieValue = RegExMatch(@subject, @pattern, 1)
set @visited = @cookieValue
 IF EMPTY(@visited) THEN
  set @id = CreateSalesforceObject("Case", 8, 
  "Status", "New", 
  "Subject", "ZS free check-up email", 
  "Type", "Custom fix", 
  "Origin", "Email",
  "Reason", "Other",  
  "AccountId", v(RequestParameter("AccountId")), 
  "OwnerID", "00G0Y000000PMtb",
  "Description", "Free check-up proposal for customer. Must convert into a sale."
  )
 ELSE
  set @id = @cookieValue
 ENDIF
]%%
Oleg Rogachov
  • 11
  • 1
  • 2