You can do this in Sprout Email by creating a Custom Event Integration. I'm not familiar with Postmaster.
While Sprout Email comes with a When an Entry is Saved event, it's not going to work for you because the Users field submits data via User IDs to create the relations and you can't create a list of recipients from the IDs along, before some extra processing.
You could create a new Custom Event which uses SproutEmail_EntriesSaveEntryEvent
as a starting point. The SproutEmail_EntriesSaveEntryEvent
can be found at sproutemail/integrations/sproutemail/SproutEmail_EntriesSaveEntryEvent.php
With a Custom Event you can customize what options are available to the Event, or just make bold assumptions based on the way you plan to be using the Event.
In your case, you'll want to update the prepareParams
method to find your user field and process it to get the user emails you need, and then return the list of emails as an array in the event object.
public function prepareParams(Event $event)
{
// Process your User Field and get your emails
$userEmails => $this->processUsersFieldIdsIntoEmails($event->params['entry']);
return array(
'value' => array(
'userEmails' => $userEmails
),
);
}
Your dynamic event object as specified by the value
parameter becomes available to your Sprout Email using Craft's object syntax.
You could then use this value in the Recipients field of your Notification Email :
{{ object.userEmails|join(',') }}
Syntax may vary depending on how you choose to hand back your list of emails, and any other variables you may want to exist in the dynamic object to use throughout your email.