direct_mail
direct_mail copied to clipboard
Sending a mail to more than one recipient
Hi,
I've extended the fe_user table with two more fields for e-mail-addresses. How can direct_mail use this two additional fields?
With the mailHeadersHook I cannot modify/extend/replace the recipient by setting the appropriate header "To". Is there any way to configure additional fields direct_mail can looking for or to override the recipient at any hook?
My environment:
- TYPO3 v7.6.10
- direct_mail v5.2.0
Greetings, FireLizard
do you mean, you want to use other field as email? I'm afraid this is not possible. See Dmailer.php this is where the fe_users (or tt_address) are fetched. And in dmailer_sendAdvanced the email address is read.
With the mailHeadersHook I cannot modify/extend/replace the recipient by setting the appropriate header "To". Is there any way to configure additional fields direct_mail can looking for or to override the recipient at any hook?
the hook is placed before the recipient is set. See setTo. And the hook won't changed the recipient address, since it just gets the text header as parameters.
Thanks for reply.
I thought I could set the recipient by modifying the mail headers as described in the documentation of SwiftMailer. But doing so is going to ignored by calling setTo().
Could a PR add the posibility to modify the recipient?
Could a PR add the posibility to modify the recipient?
if you have an idea how to do this, please do.
Maybe you will have a look at https://github.com/jokumer/xt_directmail. You can use your own DB Queryies to fetch any email field from any table.
ping @kartolo
Can you check the PR, please? What do you think about it?
Instead of allowing plain DB query in your definitions, which is dangerous from a security POV, I'd suggest you have a look at an extension of mine used in production for many years: https://extensions.typo3.org/extension/direct_mail_userfunc/ Note: the master branch is currently being reworked to be fully compatible with TYPO3 v8