Okay! So this is possible its just really hard and difficult…
First you need to decide on a trigger: something like every Email which has “XXX” in its name should be put into this workflow
Then you just take : Last activity date as a reenrollment trigger and filter down to the email you want to “track” by copying the for example email name into a custom property on the contact and filtering on this custom property. Then if you have the correct email you copy the record id of the email onto a custom contact property to have the email record id stored.
With this simple custom code, you can check the hs_Email_open_count of the email you saved on the contact: (just by “property to include in code” put the custom property where the record id of the email is saved
const hubspot = require('@hubspot/api-client');
const Access_Token = process.env.Access_Token;
const hubspotClient = new hubspot.Client({ accessToken: Access_Token });
exports.main = async (event) => {
//const emailId = event.object.objectId; // Die ID des benutzerdefinierten Objekts
const emailId = event.inputFields['the_record_id_of_the_Email'];
const properties = [
"hs_email_open_count"
];
const propertiesWithHistory = [];
const associations = undefined;
const archived = false;
const idProperty = undefined;
try {
const apiResponse = await hubspotClient.crm.objects.emails.basicApi.getById(emailId, properties, propertiesWithHistory, associations, archived, idProperty);
console.log(JSON.stringify(apiResponse, null, 2));
} catch (e) {
e.message === 'HTTP request failed'
? console.error(JSON.stringify(e.response, null, 2))
: console.error(e)
}
};
then you just need to copy the output into a custom property on the contact or idk do it in the code itself
you should prob run this in two different workflows
with 1. Workflow: should just be checking emails and see if they should copy the record id of the email onto the contact
and 2. workflow should run something like on a daily schedule with a custom property filter where it only enrolls the contacts where the email open count is checked something like this
this would be a very budget/“easy” solution to do for this “impossible” task
if you have any questions feel free to reach out, bc this is more of like a thought design of how it can work! ![]()