2015-07-24 14:37:48 +12:00
|
|
|
<?php
|
|
|
|
|
2017-08-09 11:55:09 +12:00
|
|
|
namespace SilverStripe\UserForms\Model\Recipient;
|
|
|
|
|
|
|
|
use SilverStripe\Control\Email\Email;
|
|
|
|
|
2015-07-24 14:37:48 +12:00
|
|
|
/**
|
|
|
|
* Email that gets sent to the people listed in the Email Recipients when a
|
|
|
|
* submission is made.
|
|
|
|
*
|
|
|
|
* @package userforms
|
|
|
|
*/
|
|
|
|
|
2016-07-21 17:53:59 +12:00
|
|
|
class UserFormRecipientEmail extends Email
|
|
|
|
{
|
2017-08-11 11:33:06 +12:00
|
|
|
protected $ss_template = 'SubmittedFormEmail';
|
2015-07-24 14:37:48 +12:00
|
|
|
|
2016-07-21 17:53:59 +12:00
|
|
|
protected $data;
|
2015-07-24 14:37:48 +12:00
|
|
|
|
2016-07-21 17:53:59 +12:00
|
|
|
public function __construct($submittedFields = null)
|
|
|
|
{
|
|
|
|
parent::__construct($submittedFields = null);
|
|
|
|
}
|
2015-07-24 14:37:48 +12:00
|
|
|
|
2016-07-21 17:53:59 +12:00
|
|
|
/**
|
|
|
|
* Set the "Reply-To" header with an email address rather than append as
|
|
|
|
* {@link Email::replyTo} does.
|
|
|
|
*
|
2017-08-11 12:36:28 +12:00
|
|
|
* @param string|array $address
|
|
|
|
* @param string|null $name
|
|
|
|
* @return $this
|
2016-07-21 17:53:59 +12:00
|
|
|
*/
|
2017-08-11 12:36:28 +12:00
|
|
|
public function setReplyTo($address, $name = null)
|
2016-07-21 17:53:59 +12:00
|
|
|
{
|
|
|
|
$this->customHeaders['Reply-To'] = $email;
|
2017-08-11 12:36:28 +12:00
|
|
|
return $this;
|
2016-07-21 17:53:59 +12:00
|
|
|
}
|
2015-07-24 14:37:48 +12:00
|
|
|
}
|