direct_mail icon indicating copy to clipboard operation
direct_mail copied to clipboard

Sending a mail to more than one recipient

Open FireLizard opened this issue 7 years ago • 7 comments

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

FireLizard avatar Sep 12 '17 12:09 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.

kartolo avatar Sep 20 '17 11:09 kartolo

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.

kartolo avatar Sep 20 '17 11:09 kartolo

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?

FireLizard avatar Sep 20 '17 12:09 FireLizard

Could a PR add the posibility to modify the recipient?

if you have an idea how to do this, please do.

kartolo avatar Sep 20 '17 13:09 kartolo

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.

jokumer avatar Sep 25 '17 09:09 jokumer

ping @kartolo

Can you check the PR, please? What do you think about it?

FireLizard avatar Apr 09 '18 07:04 FireLizard

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

xperseguers avatar Aug 25 '18 06:08 xperseguers