NEW Option "one email per recipient" when using bulk actions emails.

This commit is contained in:
Laurent Destailleur 2017-09-22 17:04:26 +02:00
parent 6d7db96359
commit 8578a1b825
4 changed files with 7 additions and 6 deletions

View File

@ -515,6 +515,7 @@ class FormMail extends Form
}
else
{
// Note withto may be a text like 'AllRecipientSelected'
$out.= (! is_array($this->withto) && ! is_numeric($this->withto))?$this->withto:"";
}
}

View File

@ -74,7 +74,7 @@ if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAI
$formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid);
}
$formmail->withfrom = 1;
$liste = $langs->trans("AllRecipientSelected", count($listofselectedthirdparties));
$liste = $langs->trans("AllRecipientSelected", count($arrayofselected));
if (count($listofselectedthirdparties) == 1) // Only 1 different recipient selected, we can suggest contacts
{
$liste = array();
@ -98,7 +98,7 @@ if (count($listofselectedthirdparties) == 1) // Only 1 different recipient selec
$formmail->withtoreadonly = 1;
}
$formmail->withoptiononeemailperrecipient = (GETPOST('oneemailperrecipient')=='on')?1:-1;
$formmail->withoptiononeemailperrecipient = empty($liste)?0:((GETPOST('oneemailperrecipient')=='on')?1:-1);
$formmail->withto = empty($liste)?(GETPOST('sendto','alpha')?GETPOST('sendto','alpha'):array()):$liste;
$formmail->withtofree = empty($liste)?1:0;
$formmail->withtocc = 1;

View File

@ -70,7 +70,10 @@ EMailSentToNRecipients=EMail sent to %s recipients.
EMailSentForNElements=EMail sent for %s elements.
XTargetsAdded=<b>%s</b> recipients added into target list
OnlyPDFattachmentSupported=If the PDF documents were already generated for the objects to send, they will be attached to email. If not, no email will be sent (also, note that only pdf documents are supported as attachment in mass sending in this version).
AllRecipientSelected=The %s unique recipients selected (1 email per recipient), and if an email is set.
AllRecipientSelected=The recipients of the %s record selected (if their email is known).
GroupEmails=Group emails
OneEmailPerRecipient=One email per recipient (by default, one email per record selected)
WarningIfYouCheckOneRecipientPerEmail=Warning, if you check this box, it means only one email will be sent for several different record selected, so, if your message contains substitution variables that refers to data of a record, it becomes not possible to replace them.
ResultOfMailSending=Result of mass EMail sending
NbSelected=Nb selected
NbIgnored=Nb ignored

View File

@ -811,9 +811,6 @@ Websites=Web sites
Events=Events
EMailTemplates=Emails templates
FileNotShared=File not shared to exernal public
GroupEmails=Group emails
OneEmailPerRecipient=One email per recipient (by default, one email per record selected)
WarningIfYouCheckOneRecipientPerEmail=Warning, if you check this box, it means only one email may be sent for several different record selected. If your email text contains substitution variables that refers to data of a record, it becomes not possible to replace them.
# Week day
Monday=Monday
Tuesday=Tuesday