Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recipient placeholder in email wrapper #1297

Merged
merged 14 commits into from Aug 26, 2022

Conversation

marchorst
Copy link
Contributor

With this change you are able to use the following placeholders within the email wrapper.
'#receiver_first_name#'
'#receiver_firstname#'
'#receiver_surname#'
'#receiver_lastname#'
'#receiver_email#'
'#receiver_name#'

It is also prepared to add more fields

Marc Horst and others added 2 commits August 13, 2022 11:12
As we send it to each receipient as a single mail we are using the TO Field as receipient and do not need to handle BCC/TO.
@Fasse
Copy link
Member

Fasse commented Aug 17, 2022

Could you please explain, why you remove the preferences with the option to add the recipients to BCC and set the count for it?

@marchorst
Copy link
Contributor Author

Sure, because we are sending ever email on its one, the receiver will always be alone in the "TO" field, so no need to move them to BCC. Hope this makes sense?

Copy link
Member

@Fasse Fasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we need this preferences. Some hosters don't allow to send many emails in a short time slot. Therefore we have the preferences to send one email to several recipients.

That was the problem why we don't had these placeholders. But if we want these placeholders, we could only use them if we send one email to one recipient. Maybe these placeholders will only be used if the preference is set to 1.

@marchorst
Copy link
Contributor Author

But we need this preferences. Some hosters don't allow to send many emails in a short time slot. Therefore we have the preferences to send one email to several recipients.

That was the problem why we don't had these placeholders. But if we want these placeholders, we could only use them if we send one email to one recipient. Maybe these placeholders will only be used if the preference is set to 1.

Makes sense to me.
Should we add another option like "Sending Method: <Single, Bulk>" and hide the options "Multiple recipients" and "Number of recipients" if it is set to "Single"?

@Fasse
Copy link
Member

Fasse commented Aug 18, 2022

Hmm, that could be an option. But if you don't want to add a new preference it should also work for me if the check is for preference set to 1. Than we could also set the default for new installations to 1 or to single.

@marchorst
Copy link
Contributor Author

I have now added it to the preferences.
I still need to adjust the language fields a bit, but the logic itself should work as expected.

I would say it makes more sense to add it to the preferences and make a good description, because the "Multiple Recipients" and "Number of Recipients" have no effect after that.

@marchorst marchorst requested a review from Fasse August 19, 2022 13:45
adm_program/modules/preferences/preferences.php Outdated Show resolved Hide resolved
adm_program/system/classes/Email.php Outdated Show resolved Hide resolved
adm_program/system/classes/Email.php Outdated Show resolved Hide resolved
@@ -513,6 +513,24 @@ function getPreferencePanel($group, $id, $parentId, $title, $icon, $body)
$formValues['mail_sendmail_name'],
array('maxLength' => 50, 'helpTextIdInline' => 'SYS_SENDER_NAME_DESC')
);

// Add js to show or hide mail options
$page->addJavascript('
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this is the best place to add it or if there is any "default" js how to handle things like this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

until now we have no default to handle things like this. But a default could be useful :-)

adm_program/languages/de-DE.xml Outdated Show resolved Hide resolved
adm_program/modules/ecards/ecard_function.php Outdated Show resolved Hide resolved
adm_program/system/classes/Email.php Outdated Show resolved Hide resolved
adm_program/system/classes/Email.php Outdated Show resolved Hide resolved
@@ -513,6 +513,24 @@ function getPreferencePanel($group, $id, $parentId, $title, $icon, $body)
$formValues['mail_sendmail_name'],
array('maxLength' => 50, 'helpTextIdInline' => 'SYS_SENDER_NAME_DESC')
);

// Add js to show or hide mail options
$page->addJavascript('
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

until now we have no default to handle things like this. But a default could be useful :-)

adm_program/system/classes/Email.php Outdated Show resolved Hide resolved
adm_program/system/classes/Email.php Outdated Show resolved Hide resolved
adm_program/system/classes/Email.php Outdated Show resolved Hide resolved
@Fasse Fasse merged commit 8de3ebd into Admidio:master Aug 26, 2022
@Fasse
Copy link
Member

Fasse commented Aug 26, 2022

@marchorst Thanks for this great new feature. With the release of version 4.2 I will update the doku with the new available parameters.

@Fasse Fasse changed the title Receipient Placeholder in email wrapper Recipient placeholder in email wrapper Aug 26, 2022
@xbluemonkx
Copy link

xbluemonkx commented May 28, 2023

The new params are not yet part of the doku. Had to search forever to find this ticket here.
https://www.admidio.org/dokuwiki/doku.php?id=de:2.0:e-mail-templates

@Fasse
Copy link
Member

Fasse commented May 30, 2023

This new parameters are not part of the templates. They can be used within the concrete email you want to write. There we have documented them within the email dialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants