: 5;
$this->assertEquals($supportedFlags, $regData['supportedFlags']['totalcount']);
}
+
+ /**
+ * @see 0002284: add reply-to setting to email account
+ */
+ public function testReplyToSetting()
+ {
+ $this->_account->reply_to = 'noreply@tine20.org';
+ $this->_json->saveAccount($this->_account->toArray());
+
+ $this->_foldersToClear[] = 'INBOX';
+ $messageToSend = $this->_getMessageData();
+ $this->_json->saveMessage($messageToSend);
+ $message = $this->_searchForMessageBySubject($messageToSend['subject']);
+
+ $complete = $this->_json->getMessage($message['id']);
+ $this->assertTrue(isset($complete['headers']['reply-to']), print_r($complete, true));
+ $this->assertEquals('"Tine 2.0 Admin Account" <noreply@tine20.org>', $complete['headers']['reply-to']);
+ }
}
'display_format',
'compose_format',
'preserve_format',
+ 'reply_to',
'has_children_support',
'delimiter',
'ns_personal',
{
$_mail->clearFrom();
- $from = (isset($_account->from) && ! empty($_account->from))
- ? $_account->from
- : Tinebase_Core::getUser()->accountFullName;
+ $from = $this->_getSenderName($_account);
$email = ($_message !== NULL && ! empty($_message->from_email)) ? $_message->from_email : $_account->email;
$_mail->setFrom($email, $from);
}
+
+ protected function _getSenderName($account)
+ {
+ return (isset($_account->from) && ! empty($_account->from))
+ ? $_account->from
+ : Tinebase_Core::getUser()->accountFullName;
+ }
/**
* set mail recipients
if (isset($_account->organization) && ! empty($_account->organization)) {
$_mail->addHeader('Organization', $_account->organization);
}
+
+ // add reply-to
+ if (! empty($_account->reply_to)) {
+ $_mail->setReplyTo($_account->reply_to, $this->_getSenderName($_account));
+ }
// set message-id (we could use Zend_Mail::createMessageId() here)
if ($_mail->getMessageId() === NULL) {
Zend_Filter_Input::DEFAULT_VALUE => 1,
array('InArray', array(0,1)),
),
+ 'reply_to' => array(Zend_Filter_Input::ALLOW_EMPTY => true),
// namespaces
'ns_personal' => array(Zend_Filter_Input::ALLOW_EMPTY => true),
'ns_other' => array(Zend_Filter_Input::ALLOW_EMPTY => true),
$this->setApplicationVersion('Felamimail', '9.3');
$this->setTableVersion('felamimail_account', '22');
}
+
+
+ /**
+ * update to 9.4
+ *
+ * @see 0002284: add reply-to setting to email account
+ */
+ public function update_3()
+ {
+ if ($this->getTableVersion('felamimail_account') < 23) {
+ $declaration = new Setup_Backend_Schema_Field_Xml('
+ <field>
+ <name>reply_to</name>
+ <type>text</type>
+ <length>255</length>
+ </field>');
+ $this->_backend->addCol('felamimail_account', $declaration, 19);
+ $this->setTableVersion('felamimail_account', 23);
+ }
+
+ $this->setApplicationVersion('Felamimail', '9.4');
+ }
}
<?xml version="1.0" encoding="utf-8"?>
<application>
<name>Felamimail</name>
- <version>9.3</version>
+ <version>9.4</version>
<order>30</order>
<status>enabled</status>
<tables>
<table>
<name>felamimail_account</name>
- <version>22</version>
+ <version>23</version>
<declaration>
<field>
<name>id</name>
<default>false</default>
</field>
<field>
+ <name>reply_to</name>
+ <type>text</type>
+ <length>255</length>
+ </field>
+ <field>
<name>ns_personal</name>
<type>text</type>
<length>255</length>
case 'display_format':
case 'compose_format':
case 'preserve_format':
+ case 'reply_to':
break;
default:
item.setDisabled(true);
[0, this.app.i18n._('No')],
[1, this.app.i18n._('Yes')]
]
+ }, {
+ fieldLabel: this.app.i18n._('Reply-To Email'),
+ name: 'reply_to',
+ vtype: 'email'
}]]
}]
};
{ name: 'display_format' },
{ name: 'compose_format' },
{ name: 'preserve_format' },
+ { name: 'reply_to' },
{ name: 'ns_personal' },
{ name: 'ns_other' },
{ name: 'ns_shared' },