}
public function sendEmail() {
+ global $core;
if (!$this->_checkHash()) {
return;
}
+
+ $dao = new wsDAOBook($core->con);
+ $book = $dao->selectById($this->args['id']);
+
+ $return = 'postmaster@fluidbook.com';
+
// Send the email
$mail = new cubeMail();
- $mail->returnPath = 'postmaster@fluidbook.com';
+ $mail->returnPath = $return;
$mail->acknowledge = isset($this->args['askAcknowledge']) && $this->args['askAcknowledge'];
$mail->charset = 'UTF-8';
$mail->to = $this->args['email'];
- $mail->from = $this->args['fromname'] . '<' . $this->args['fromemail'] . '>';
+ if ($book->parametres->sendasfluidbook) {
+ $mail->from = $this->args['fromname'] . '<' . $return . '>';
+ $mail->replyTo = $this->args['fromname'] . '<' . $this->args['fromemail'] . '>';
+ } else {
+ $mail->from = $this->args['fromname'] . '<' . $this->args['fromemail'] . '>';
+ }
$mail->subject = $this->args['subject'];
$mail->body = $this->args['body'];
$this->xml->addChild('ok', $mail->send() ? '1' : '0');
$groups[] = $group;
}
+ $return = 'postmaster@fluidbook.com';
$total = count($groups);
foreach ($groups as $i => $g) {
// Send the email
$mail = new cubeMail();
- $mail->returnPath = 'postmaster@fluidbook.com';
+ $mail->returnPath = $return;
$mail->acknowledge = isset($this->args['askAcknowledge']) && $this->args['askAcknowledge'];
$mail->charset = 'UTF-8';
$mail->to = $this->args['email'];
- $mail->from = $this->args['fromname'] . '<' . $this->args['fromemail'] . '>';
+ if ($book->parametres->sendasfluidbook) {
+ $mail->from = $this->args['fromname'] . '<' . $return . '>';
+ $mail->replyTo = $this->args['fromname'] . '<' . $this->args['fromemail'] . '>';
+ } else {
+ $mail->from = $this->args['fromname'] . '<' . $this->args['fromemail'] . '>';
+ }
$mail->subject = $this->args['subject'] . $s;
$mail->body = $this->args['body'];
foreach ($g as $f) {
$this->fields['email_body'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Corps de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut'));
$this->fields['email_editable'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Permettre au lecteur de modifier le corps de l'email"));
$this->fields['askAcknowledge'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Demander au destinataire un accusé de réception"), 'grade' => 3);
+ $this->fields['sendasfluidbook'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Envoyer le mail comme Fluidbook"), 'grade' => 3, 'hint' => __("L'expéditeur apparaîtra en reply-to"));
$this->fields['facebook_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre du contenu partagé"), 'hint' => __('Titre proposé sur les fonction de partage (par défaut, titre de la publication)'));
$this->fields['facebook_description'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Description du contenu partagé"), 'grade' => 1, 'hint' => __('Description proposée sur les fonctions de partage (par défaut, vide)'));
$this->fields['friendWidth'] = array('type' => 'integer', 'default' => 319, 'editable' => true, 'label' => __('Largeur du menu'), 'grade' => 5);
$this->fields['friendHeight'] = array('type' => 'integer', 'default' => 500, 'editable' => true, 'label' => __('Largeur du menu'), 'grade' => 5);
$this->forms['share'] = array('label' => __('Fonctions de partage'),
- 'fieldsnames' => array('share', '|', 'email_title', 'email_body', 'email_editable', 'askAcknowledge', '|',
+ 'fieldsnames' => array('share', '|', 'email_title', 'email_body', 'email_editable', 'askAcknowledge', 'sendasfluidbook', '|',
'facebook_title', 'facebook_description', 'facebook_image', 'twitter_description', '|',
'friend', 'facebook', 'twitter', 'googleplus', 'linkedin', 'viadeo', '|', 'customSharer', '|', 'friendWidth', 'friendHeight'));
// .