Testing an Object Trigger Before Sending

Before sending a triggered email through Marketing Cloud Connect for Marketing Cloud Engagement, use a test script. Repeat the script for each object with a trigger setup. Ensure that the object’s defined properties account for all required properties on an object.

This example script checks the Contact object, where LastName='TestExample'.

{

  private static testmethod void ContactTriggerTest()

  {     

           insert new et4ae5__Configuration__c(et4ae5__Support_Ticket_Recipient__c = 'example@example.com');

           Test.startTest();

           Contact c = new Contact(LastName='TestExample');

           // Insert contact

           insert c;

           // If no exceptions occurred, it was successful 

           System.assert(!String.isBlank(c.Id));

           Test.stopTest();

  }

}