Add Person activity to email alert

Add Person activity to email alert

I would like to be able to share a Person's activity directly in an email alert.

The set would include:

Inserting a token to include a simple listing of the most recent activity attributed to the Person, like the Person's Activity Log

Adding this feature would enable users to view activity logs directly via email and save them logging into Marketo or CRM to find this information.

And even better, if they are using a user who isn't active on Marketo or CRM, they have unfiltered access too!

15 Comments
Dan_Stevens_
Level 10 - Champion Alumni

You can sort of do this today with some minimal customization:

Create an "Interesting Moments History" field (text field, not string).  Then include an additional flow step (#3 in the screenshot below) within each IM trigger campaign that you want to include in the history field:

pastedImage_1.png

pastedImage_0.png

NOTE: We also increment an IM score field as part of this process.

The full value of the concatenated field is as follows:

{{lead.Last Interesting Moment Date}}: {{lead.Last Interesting Moment Desc}}{{my.line-break}}{{lead.Avanade Interesting Moment History}}

And the "line-break" token that's used is achieved by using Sanford Whiteman​'s approach, documented here:

http://blog.teknkl.com/dark-mkto-alleys-line-break-token/  (don't be intimidated by the amount of detail here; as long as you follow the step-by-step instructions, it's actually very easy to implement.  Also, we implemented this at the folder level of all of our operational programs/campaign - which enables you to only create this once and use the {{my.line-break}} token in as many programs/campaigns within that folder).

You can now insert the {{lead.Interesting Moments History}} field as a token in your alerts.

Harvey_Jewell2
Level 1

Thanks very much!

Kate_Goldsmith
Level 3 - Champion Alumni

Hi Dan,

Is there a way to add a limit to the number of recent IMs displayed so that this doesn't become a ridiculously long sales alert email if we are dealing with a super active prospect?

Thanks,
Kate

SanfordWhiteman
Level 10 - Community Moderator

Only by keeping the field trimmed using a webhook.

SanfordWhiteman
Level 10 - Community Moderator

Oh, or of course using Velocity to trim the number displayed!

Kate_Goldsmith
Level 3 - Champion Alumni

Thanks for the suggestions, Sanford!

I'm not brilliantly technical - is there a step-by-step on how I would do the webhook to trim returned values or Velocity code to trim numbers displayed anywhere?

Kate_Goldsmith
Level 3 - Champion Alumni

The line break email script didn't work for us. Enlisting the help of a developer friend, we replaced the line break token in Marketo with a random symbol not used elsewhere in our instance:

pastedImage_1.png

and wrote this Email Velocity script in the token:

<ul>
#foreach( $stringList in $lead.interestingMomentHistory.split("[¬]") )
<li>
${stringList}
</li>
#end
</ul>

pastedImage_2.png

To produce this:

pastedImage_4.png

 We had to put this token at the highest level architecturally, as it spanned multiple folders. 

SanfordWhiteman
Level 10 - Community Moderator

Don't know thy the line break token didn't work for you, it's used in dozens of instances.

Anyway, you're not trimming the list here, just outputting it.

To show the most recent N values, where N is set via the variable $maxMomentsToDisplay:

#set( $maxMomentsToDisplay = 3 )
#set( $interestingMoments = $lead.interestingMomentHistory.split("¬") )
#set( $endIndex = $interestingMoments.size() )
#set( $startIndex = $math.sub( $interestingMoments.size(), $maxMomentsToDisplay, 1 ) )
#if( $startIndex.signum($startIndex).equals(-1) )
#set( $startIndex = 0 )
#end
<ul>
#foreach( $iM in $interestingMoments.subList( $startIndex, $endIndex ) )
<li>
${iM}
</li>
#end
</ul>‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Please try to use the syntax highlighter when posting code, not screenshots, because subtle typos are undetectable in images.

Kate_Goldsmith
Level 3 - Champion Alumni

Hi Sanford,

Thanks for your input here - you saved us a lot of time!

We adjusted the code slightly to get the most recent values:

#set( $maxMomentsToDisplay = 10 )
#set( $interestingMoments = $lead.interestingMomentHistory.split("¬") )
#set( $endIndex = $maxMomentsToDisplay )
#set( $startIndex = 0 )
#if( $endIndex > $interestingMoments.size() )
#set( $endIndex = $interestingMoments.size() )
#end
<ul>
#foreach( $iM in $interestingMoments.subList( $startIndex, $endIndex ) )
<li>
${iM}
</li>
#end
</ul>‍‍‍‍‍‍‍‍‍‍‍‍‍‍
SanfordWhiteman
Level 10 - Community Moderator

If you're storing the values backwards, yes. I store them as an actual appending log.