I would advise to clearly separate persisting an dispatching of emails.

First persist them. Then have a separate process/task that queries the
database for undispatched emails. Then dispatch them and in case of
success, mark them as dispatched and persist them again.

Good luck!
On Jul 30, 2015 10:56 AM, "Nima Sadjadi" <[email protected]> wrote:

>
> Hi,
>
> I have $emailparams array in config file, the I use
> $email = new Email($emailparams);
> to send emails.
> In entity class I have this:
> $metadata->addEntityListener('prePersist', '\Listeners',
> 'prePersistHandler');
> and it works fine. but I need to call
> $email = new Email($emailparams);
> within the listener to use email service, since $emailparams array is not
> gloabl, how can I have access to this array within listener?
> How can I pass this data array to entity then how to pass from entity to
> listener?
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "doctrine-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to