Skip to content

Commit

Permalink
Use server defined notification message for enotify (Request #8784)
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Apr 15, 2014
1 parent eeb5eff commit 770646a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ingo/lib/Script/Sieve/Action/Notify.php
Expand Up @@ -54,14 +54,18 @@ public function __construct($vars = array())
public function generate()
{
$addr = Ingo_Script_Sieve::escapeString($this->_vars['address']);
$msg = _("You have received a new message") . "\n" .
_("From:") . " \$from\$ \n" .
_("Subject:") . " \$subject\$ \n" .
_("Rule:") . ' ' . $this->_vars['name'];

return $this->_vars['notify']
? 'notify :method "mailto" :options "' . $addr . '" :message "' . $msg . '";'
: 'notify :message "' . $msg . '" "mailto:' . $addr . '";';
if ($this->_vars['notify']) {
return 'notify :method "mailto" :options "' . $addr .
'" :message "' ._("You have received a new message") . "\n" .
_("From:") . " \$from\$ \n" .
_("Subject:") . " \$subject\$ \n" .
_("Rule:") . ' ' . $this->_vars['name'] . '";';
}

// RFC 5436 defines mailto: behavior. Use the default
// server-defined notification message.
return 'notify "mailto:' . $addr . '";';
}

/**
Expand Down

0 comments on commit 770646a

Please sign in to comment.