SOLVED

Send an automated email to a specific opportunity contact role 24 hours after an opportunity is closed won

Go to solution
SanfordWhiteman
Level 10 - Community Moderator

Re: Send an automated email to a specific opportunity contact role 24 hours after an opportunity is closed won

Most businesses want to have uniformity (easily achieved with a batch) when sending out such correspondence. i.e If my account rep marks a contract as closed at 5 pm, you're probably trying to send your client an email connecting them with their new CSM at a time other than 5pm the next day, but maybe that's just me.

I don't think there's a "most businesses" rule here, and we don't need to change business logic if the platform doesn't require it. After all, the reason Wait Steps exist is to allow for time-relative reactions to triggers, and the [End On] constraint allows for more flexibility than just 5pm-5pm.

Anonymous
Not applicable

Re: Send an automated email to a specific opportunity contact role 24 hours after an opportunity is closed won

Sure, Sanford. You're free to think whatever you like. If the user needs this to be a trigger, they can keep it as such.

Grégoire_Miche2
Level 10

Re: Send an automated email to a specific opportunity contact role 24 hours after an opportunity is closed won

Further, it's very easy to get "trigger happy" and bog your system down after awhile

I know of a Marketo instance that is having 22000+ active triggers and is still working fine. Do not take me wrong here, I am not saying that we should use triggers without any discernment, but simply that the level of triggers at which you would clutter your instance is quite high. So create triggers when you need them and get rid of them when you don't (such as in engagement programs for instance...)

-Greg

Anonymous
Not applicable

Re: Send an automated email to a specific opportunity contact role 24 hours after an opportunity is closed won

Grégoire Michel wrote:

I know of a Marketo instance that is having 22000+ active triggers and is still working fine. Do not take me wrong here, I am not saying that we should use triggers without any discernment, but simply that the level of triggers at which you would clutter your instance is quite high. So create triggers when you need them and get rid of them when you don't (such as in engagement programs for instance...)

That's interesting. I've ran into this issue with far fewer trigger campaigns than 22000+. There were also a tremendous number of smart lists also. I've always been told that yes if you need a trigger use it, but be judicious with them.

I wonder why my experience would be different. Perhaps the triggers had less to do with it than the smart lists? Hard to know.

Grégoire_Miche2
Level 10

Re: Send an automated email to a specific opportunity contact role 24 hours after an opportunity is closed won

It really depends on how often the triggers are evaluated and fired. You can have many, but only a few tens of "lead is  created", "clicks link in email" or "opens email" will kill you instance performance, for instance.

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Re: Send an automated email to a specific opportunity contact role 24 hours after an opportunity is closed won

+1.

And just for fun, a way to visualize the event model in the browser is with a page like this.

The page has 30,000 distinct DOM event listeners -- 10,000 bound to each of 3 containers.

  • One container only listens for clicks.
  • The other two both listen for mousemoves (e.g. continually fire for as long as you hover over the area). But one fires a mostly empty function (just returns true), while the other fires a function that does real work (a querySelector() call).

So #1 can be thought of as a Marketo trigger that's bound in many SCs but only sporadically qualifies people; #2 is like a Marketo trigger that qualifies a lot of people but doesn't do a lot in the corresponding flow; #3 is like a trigger that both qualifies a lot of people and does a lot of work once qualified.

If you hover over each area for the same amount of time, say 1 minute, you'll see a CPU profile like this:

pastedImage_4.png

Although it's prepared to fire 10,000 times, you don't see the click listener at all in the profile, since you didn't click.  And the minimal mousemove listener fires millions of times, but uses a tiny amount of CPU compared to the more weighty mousemove listener.

While Marketo's event handling code is obviously not the same as the browser's JS engine, the architectural concept is similar enough to make the point.

Ray_Miller
Level 2

Re: Send an automated email to a specific opportunity contact role 24 hours after an opportunity is closed won

I think I understand why I want to move to a batch campaign...yes the field is in Salesforce my understanding is: the trigger would require the rep to have added the OCR to to oppty before the closed checkbox is marked true, if they're added after even directly after they check the box these will not evaluate to be true.

Sanford Whiteman​ is there any good literature either on marketo or elsewhere on the best way to evaluate your instances triggers versus batch campaigns? I inherited this marketo instance and feel as though there is probably a lot of bad practice as only a few members of the team were marketing automation users before using it,

Grégoire_Miche2
Level 10

Re: Send an automated email to a specific opportunity contact role 24 hours after an opportunity is closed won

Hi Ray,

There is a risk in the way your trigger is set with a filter: there is no reason the opportunity that fires the trigger is the same as the opportunity in the "was added to opportunity" filter. If the person is added to 2 oppies simultaneously, it may lead to false positives.

There is no way around it as the "role" constraint is only available on the filter, not on the trigger. Still, I would add the "CC Self-Service Welcome", "Sales Type" and "Vertical" constraints to the trigger and the "sales closed" constraint to the filter to remove some of the discrepancies.

and vote here:

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Re: Send an automated email to a specific opportunity contact role 24 hours after an opportunity is closed won

If the person is added to 2 oppies simultaneously, it may lead to false positives.

Absolutely! But here we have a false negative, which means the overly broad interpretation of the filter wouldn't be the cause.

I think the direct cause is exactly what Devraj said above:

at the time the contact's opportunity is updated to "Sales Closed: True", they do not qualify for all of the filters in "Was Added to Opportunity"

Therefore I think an SFDC-side trigger on Opportunity is the solution. Don't let the Oppty get closed unless business criteria have been met -- either with the current Sales Closed​ field or a secondary field dedicated to this flow.

Grégoire_Miche2
Level 10

Re: Send an automated email to a specific opportunity contact role 24 hours after an opportunity is closed won

Yes, agreed on this, In fact, I am not saying the contrary

Getting sales to add contacts into the OCR table is a never ending fight. It is a fight that the sales managers need to get involved in: they should not tolerate that opportunities are managed without the company knowing who are the relevant contacts.

We also often modify SFDC setup to improve the OCR completion rates (such as removing the possibility to create oppies from the account or opportunity tabs, setting an OCR counter on oppies and adding validation rules to it, etc...)

-Greg