本文整理汇总了PHP中CakeEmail::replyTo方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeEmail::replyTo方法的具体用法?PHP CakeEmail::replyTo怎么用?PHP CakeEmail::replyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakeEmail
的用法示例。
在下文中一共展示了CakeEmail::replyTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
public function send()
{
if ($this->request->is('post')) {
// Check security token
if (empty($this->request->data['Feedback']['token']) || $this->request->data['Feedback']['token'] != '!pilule$') {
throw new NotFoundException();
}
// Send feedback via email
$Email = new CakeEmail();
if (!empty($this->request->data['Feedback']['name']) && !empty($this->request->data['Feedback']['email'])) {
$Email->replyTo(array($this->request->data['Feedback']['email'] => $this->request->data['Feedback']['name']));
}
$Email->from('web@alexandreclement.com');
$Email->to('web@alexandreclement.com');
$Email->config('postmark');
$Email->subject('Pilule - Commentaires');
$Email->template('feedback');
$Email->emailFormat('html');
$Email->viewVars(array('message' => $this->request->data));
if ($Email->send()) {
return new CakeResponse(array('body' => json_encode(array('status' => true))));
} else {
return new CakeResponse(array('body' => json_encode(array('status' => false))));
}
} elseif ($this->request->is('ajax')) {
$this->layout = 'ajax';
$this->render('modals/form');
}
}
示例2: contact
/**
* Contact form for new users. Creates a new User based on their form information. User has a specific
* "new user" role and placeholders for username and password.
* @param bool $sent - indicates if the form is new or being loaded after information has been sent.
* @return void
*/
public function contact($sent = false)
{
if ($this->request->is('post')) {
$this->loadModel('Role');
$this->loadModel('User');
//set the User up as a NEW USER
$this->request->data['User']['role_id'] = Role::NEW_USER;
//add a temp username and password
$this->request->data['User']['username'] = User::TEMP_USERNAME;
$this->request->data['User']['password'] = User::TEMP_PASSWORD;
$this->User->create();
if ($this->User->save($this->request->data)) {
$Email = new CakeEmail();
$Email->config('gmail');
//TO-DO:: Figure out the proper configuration for using GreenGeeks webmail
//$Email->config('unlessWeb');
$Email->from(array($this->request->data['User']['email'] => $this->request->data['User']['first_name']));
$Email->to('jasmun@unlessweb.com');
$Email->subject('Someone is interested in Evolved Foods....');
$Email->replyTo($this->request->data['User']['email']);
$Email->send($this->request->data['User']['message']);
return $this->redirect(array('action' => 'contact', true));
} else {
$this->Session->setFlash(__('The user could not be saved. Please, try again.'));
}
}
$this->set('sent', $sent);
}
示例3: email2
public function email2($text = null, $correio_destino)
{
App::uses('CakeEmail', 'Network/Email');
$Email = new CakeEmail('gmail');
$Email->to(array($correio_destino, 'recepcao@yopmail.fr'));
$Email->emailFormat('html');
$Email->template('notification')->viewVars(array('text' => $text));
$Email->subject('Sistema de Notificacao');
$Email->replyTo('the_mail_you_want_to_receive_replies@yourdomain.com');
$Email->from('your_user@gmail.com');
$Email->send();
//return $this->redirect(array('controller' => 'reports','action' => 'all'));
}
示例4: send
/**
* Sends out email via SendGrid
*
* @return bool
*/
public function send(CakeEmail $email)
{
// CakeEmail
$this->_cakeEmail = $email;
$this->_config = $this->_cakeEmail->config();
if (empty($this->_config['count']) || $this->_config['count'] > 500) {
$this->_config['count'] = 500;
}
$this->_headers = $this->_cakeEmail->getHeaders();
$this->_recipients = $email->to();
$this->_replyTo = $email->replyTo();
return $this->_sendPart();
}
示例5: send
/**
* Sends out email via Mandrill
*
* @param CakeEmail $email
* @return array
*/
public function send(CakeEmail $email)
{
// CakeEmail
$this->_cakeEmail = $email;
$from = $this->_cakeEmail->from();
list($fromEmail) = array_keys($from);
$fromName = $from[$fromEmail];
$this->_config = $this->_cakeEmail->config();
$this->_headers = $this->_cakeEmail->getHeaders();
$message = array('html' => $this->_cakeEmail->message('html'), 'text' => $this->_cakeEmail->message('text'), 'subject' => mb_decode_mimeheader($this->_cakeEmail->subject()), 'from_email' => $fromEmail, 'from_name' => $fromName, 'to' => array(), 'headers' => array('Reply-To' => $this->_cakeEmail->replyTo()), 'important' => false, 'track_opens' => null, 'track_clicks' => null, 'auto_text' => null, 'auto_html' => null, 'inline_css' => null, 'url_strip_qs' => null, 'preserve_recipients' => null, 'view_content_link' => null, 'tracking_domain' => null, 'signing_domain' => null, 'return_path_domain' => null, 'merge' => true, 'tags' => null, 'subaccount' => null);
$message = array_merge($message, $this->_headers);
foreach ($this->_cakeEmail->to() as $email => $name) {
$message['to'][] = array('email' => $email, 'name' => $name, 'type' => 'to');
}
foreach ($this->_cakeEmail->cc() as $email => $name) {
$message['to'][] = array('email' => $email, 'name' => $name, 'type' => 'cc');
}
foreach ($this->_cakeEmail->bcc() as $email => $name) {
$message['to'][] = array('email' => $email, 'name' => $name, 'type' => 'bcc');
}
$attachments = $this->_cakeEmail->attachments();
if (!empty($attachments)) {
$message['attachments'] = array();
foreach ($attachments as $file => $data) {
if (!empty($data['contentId'])) {
$message['images'][] = array('type' => $data['mimetype'], 'name' => $data['contentId'], 'content' => base64_encode(file_get_contents($data['file'])));
} else {
$message['attachments'][] = array('type' => $data['mimetype'], 'name' => $file, 'content' => base64_encode(file_get_contents($data['file'])));
}
}
}
$sendAt = null;
if (!empty($this->_headers['X-SendAt'])) {
$sendAt = $this->_headers['X-SendAt'];
}
$params = array('message' => $message, "async" => false, "ip_pool" => null, "send_at" => $sendAt);
return $this->_exec($params);
}
示例6: accountCompleteMail
public static function accountCompleteMail($user)
{
App::uses('CakeEmail', 'Network/Email');
$email = new CakeEmail();
$email->config('default');
$email->domain('nativecamp.net');
$email->emailFormat('text');
$email->template('account_complete');
$email->viewVars(array('name' => $user['nickname']));
$email->to($user['email']);
$email->from('info@nativecamp.net', 'NativeCamp運営事務局');
$email->replyTo('info@nativecamp.net');
$email->returnPath('info@nativecamp.net', 'NativeCamp運営事務局');
# $email->subject(__('Account Activation').' - '.Configure::read('my.site_name'));
$email->subject("ネイティブキャンプ:事前登録完了メール");
$email->send();
}
示例7: send
/**
* Send
*
* A bit of a misnomer, because this actually just adds it to a CakeResque
* queue. The actual sending of the email will be performed later by a worker.
*
* @params CakeEmail $email
* @return array
*/
public function send(CakeEmail $email)
{
// Take a copy of the existing configuration.
$config = array('headers' => $email->getHeaders(), 'from' => $email->from(), 'sender' => $email->sender(), 'replyTo' => $email->replyTo(), 'readReceipt' => $email->readReceipt(), 'returnPath' => $email->returnPath(), 'to' => $email->to(), 'cc' => $email->cc(), 'bcc' => $email->bcc(), 'subject' => $email->subject(), 'viewRender' => $email->viewRender(), 'viewVars' => $email->viewVars(), 'emailFormat' => $email->emailFormat(), 'messageId' => $email->messageId(), 'attachments' => $email->attachments());
// unset($config['config']['transport']);
$template = $email->template();
$config['template'] = $template['template'];
$config['layout'] = $template['layout'];
// Clean it up to avoid errors.
$config = array_filter($config, function ($v) {
return (bool) $v;
});
debug($config);
// Include a message, if they sent one via plain text.
$message = $email->message(CakeEmail::MESSAGE_HTML) ? null : $email->message(CakeEmail::MESSAGE_TEXT);
// Drop it in a queue.
Resque::enqueue('email', 'ResqueEmail.EmailShell', array('send', $config, $message));
return array('headers' => $email->getHeaders(), 'message' => $email->message());
}
示例8: sendBill
/**
* @param $order
* @param $to
* @param $filename
*/
public function sendBill($order, $to, $filename)
{
$Email = new CakeEmail('gmail');
$Email->emailFormat('html');
$Email->template('order_details_mail')->viewVars(array('order' => $order));
$Email->to($to);
$Email->subject('Receipt - MadDollTees');
$Email->replyTo('maddolltees@gmail.com');
$Email->from('maddolltees@gmail.com');
$Email->attachments('../webroot/pdf/' . $filename . '.pdf');
$Email->send();
$Email = new CakeEmail('gmail');
$Email->emailFormat('html');
$Email->template('order_details_to_admin')->viewVars(array('order' => $order));
$Email->to('maddolltees@gmail.com');
$Email->subject('Receipt - MadDollTees');
$Email->replyTo('maddolltees@gmail.com');
$Email->from('maddolltees@gmail.com');
$Email->attachments('../webroot/pdf/' . $filename . '.pdf');
$Email->send();
}
示例9: buildRequest
protected function buildRequest(CakeEmail $email)
{
$sender = $email->from();
if (key($sender) != 'mailerloop@mailerloop.com') {
$this->data['fromEmail'] = key($sender);
$this->data['fromName'] = reset($sender);
}
$replyTo = $email->replyTo();
if (!empty($replyTo)) {
$this->data['replyToEmail'] = key($replyTo);
$this->data['replyToName'] = reset($replyTo);
}
$headers = $email->getHeaders(array('subject', 'id', 'language'));
if (empty($headers['id'])) {
throw new CakeException("ID header is required");
}
$this->data['templateId'] = $headers['id'];
if (!empty($headers['language'])) {
$this->data['language'] = $headers['language'];
}
$variables = $email->viewVars();
$variables['subject'] = $headers['Subject'];
$recipients = array_merge($email->to(), $email->cc(), $email->bcc());
if (count($recipients) > 1) {
$this->data['batch'] = array();
foreach ($recipients as $recipientEmail => $recipientName) {
$this->data['batch'][] = array('variables' => $variables, 'templateId' => $headers['id'], 'recipientName' => $recipientName, 'recipientEmail' => $recipientEmail);
}
} else {
$this->data['recipientName'] = reset($recipients);
$this->data['recipientEmail'] = key($recipients);
$this->data['variables'] = $variables;
}
$this->addAttachments($email);
return $this->data;
}
示例10: mail
/**
* Diese Funktion ist für die E-Mail Funktion zuständig
* Wird ein GET-Parameter übergeben, so wird der Parameter in das Addressfeld geschrieben
* Ein POST-Request löscht schließlich den E-Mail Versand aus
* @param String $to = Der Empfänger, der im Adressfeld angezeigt werden soll
* @author jgraeger
*/
public function mail($data = null)
{
//Setzt den Empfänger in der Addresszeile
if ($this->request->is('get')) {
$this->set('receiver', $data);
}
if ($this->request->is('post')) {
$this->set('receiver', $this->request->data['Mail']['mailTo']);
$receivers = $this->User->validateReceivers($this->request->data);
//Prüfe ob alle E-Mail-Adresse valide sind (Also nur an Mitarbeiter versendet wird):
$invalidData = array();
$validReceivers = array();
foreach ($receivers as $receiver) {
if (!$receiver['valid']) {
array_push($invalidData, $receiver['input']);
} else {
array_push($validReceivers, $receiver['mail']);
}
}
//Wenn alle EMail-Adressen gültig sind -> Fahre fort
if ($invalidData == array()) {
//Alle Empfänger sind gültig. Jetzt wird die E-Mail generiert
$sender = $this->User->findById($this->Auth->user('id'));
$senderName = $sender['User']['username'];
$senderMail = $sender['User']['mail'];
$EMail = new CakeEmail();
// $EMail->from(array('Humboldt Cafeteria ['.$senderName.']'));
$EMail->to($validReceivers);
$EMail->subject($this->request->data['Mail']['subject']);
$EMail->config('web');
$EMail->template('default');
$EMail->replyTo($senderMail == '' ? 'noreply@example.com' : $senderMail);
$EMail->emailFormat('html');
$EMail->viewVars(array('senderName' => $senderName, 'senderMail' => $senderMail == '' ? 'keine E-Mail angegeben' : $senderMail, 'content' => $this->request->data['Mail']['content'], 'subject' => $this->request->data['Mail']['subject'], 'allowReply' => true));
if ($EMail->send()) {
$this->Session->setFlash('Die E-Mail wurde erfolgreich abgeschickt.', 'alert-box', array('class' => 'alert alert-success'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash('Es ist ein Fehler aufgetreten.', 'alert-box', array('class' => 'alert-error'));
}
} else {
//Gebe in einer Fehlermeldung aus, welche Adressen/Benutzernamen fehlerhaft sind
$invalidData = implode(',', $invalidData);
$string = "Die Nachricht konnte nicht gesendet werden, da folgende Empfänger keine Mitarbeiter der Cafeteria sind: " . $invalidData;
$this->Session->setFlash($string, 'alert-box', array('class' => 'alert alert-block alert-error'));
}
}
//Aktionen für die Seitenleiste
$actions = array('back' => array('text' => 'Zur Telefonliste', 'params' => array('controller' => 'contacts', 'action' => 'index')));
//Nur für Admins sichtbar:
if ($this->isAdmin()) {
$actions['mailToAll'] = array('text' => 'Rundmail verschicken', 'params' => array('controller' => 'mail', 'action' => 'index'));
}
$this->set('actions', $actions);
}
示例11: SendRequestStatusDetailsToClient
public function SendRequestStatusDetailsToClient(array $details, $to)
{
$subject = 'Mobile Workshop | Request Status.';
$msg = "Hello" . $details['user_name'] . ", .\n";
$msg .= "Please be informed the status of your request has changed on the mobile workshop portal: .\n";
$msg .= "Request Code: " . $details['code'] . "\n";
$msg .= "New Status: " . $details['status'] . "\n";
$msg .= "Thank you!";
if (!$to) {
$to = 'info@rolling.ng';
}
$t = strftime('%Y-%m-%d %T ');
$body = "Rolling Mobile Workshop.\n" . $t . "\n" . $msg;
$Email = new CakeEmail('gmail');
$Email->to($to);
$Email->subject($subject);
$Email->replyTo('workshop@rolling.ng');
$Email->from(array('Rolling Mobile Workshop' => 'mobileworkshop.ng@gmail.com'));
$Email->send($body);
}
示例12: sendFeedback
public function sendFeedback()
{
if ($this->request->is('post') || $this->request->is('put')) {
$data = $this->request->data['User'];
$emailProfile = Configure::read('emailProfile');
$Email = new CakeEmail($emailProfile);
$Email->from(array($data['email'] => $data['email']));
$Email->to("mpperez3@esei.uvigo.es");
$Email->cc(array('analia@uvigo.es', 'gprodriguez2@esei.uvigo.es'));
$Email->subject('[MARKYT] ' . $data['subject']);
$data["body"] = $data["body"] . "<p>==============================</p><h2>Please don't reply</h2>";
App::import('Vendor', 'HTMLPurifier', array('file' => 'htmlpurifier' . DS . 'library' . DS . 'HTMLPurifier.auto.php'));
$config = HTMLPurifier_Config::createDefault();
$dirty_html = $data["body"];
$purifier = new HTMLPurifier($config);
$data["body"] = $purifier->purify($dirty_html);
$Email->replyTo($data['email']);
// $this->Email->from = 'Cool Web App <app@ejemplo.com>';
$Email->emailFormat('html');
// $Email->template('recoverMarky');
// $Email->viewVars(array('user' => $userFind['User']['username'],
// 'password' => $newPassword));
$send = $Email->send($data["body"]);
if ($send) {
return $this->correctResponseJson(json_encode(array('success' => true)));
} else {
CakeLog::write('MailLog', 'Error send password to: ' . $data['email']);
return $this->correctResponseJson(json_encode(array('success' => false)));
}
}
}
示例13: email
public function email($username = null)
{
$this->layout = 'home';
$verificar = $this->verificar_email($username);
$verificar_email = $verificar[0][0]["exists (select tb_pessoa.username from tb_pessoa where tb_pessoa.username='" . $username . "')"];
if ($verificar_email == 1) {
$novaSenha = $this->geraSenha();
$this->alterarSenha($novaSenha, $username);
$Email = new CakeEmail('gmail');
$Email->to($username);
$Email->subject('Nova Senha ProFinder');
$Email->replyTo('profindertcc@gmail.com');
$Email->from('profindertcc@gmail.com');
$Email->send("Sua nova senha é " . $novaSenha);
return $this->redirect(array('action' => 'cadastro'));
} else {
$this->Session->setFlash(__('Esse e-mail não está cadastrado na base de dados!', "flash_notification"));
return $this->redirect(array('action' => 'cadastro'));
}
//return $this->redirect(array('action' => 'index'));
}
示例14: XTCPDF
//.........这里部分代码省略.........
</tr>
<tr>
<td width="50%"></td>
<td width="25%">Full (Rs.)</td>
<td width="25%">Actual (Rs.)</td>
</tr>
<tr>
<td width="50%">PF</td>
<td width="25%">' . $employee['Employee']['pf'] . '</td>
<td width="25%">' . $this->request->data['SalaryRecord']['pf'] . '</td>
</tr>
<tr>
<td width="50%">ESI</td>
<td width="25%">' . $employee['Employee']['esi'] . '</td>
<td width="25%">' . $this->request->data['SalaryRecord']['esi'] . '</td>
</tr>
<tr>
<td width="50%">TDS</td>
<td width="25%">' . $employee['Employee']['income_tax'] . '</td>
<td width="25%">' . $this->request->data['SalaryRecord']['income_tax'] . '</td>
</tr>
<tr>
<td width="50%">Advance</td>
<td width="25%">0</td>
<td width="25%">0</td>
</tr>
<tr>
<td width="50%">Loan</td>
<td width="25%">0</td>
<td width="25%">0</td>
</tr>
<tr>
<td width="50%"></td>
<td width="25%"></td>
<td width="25%"></td>
</tr>
<tr>
<td width="50%"></td>
<td width="25%"></td>
<td width="25%"></td>
</tr>
<tr>
<td width="50%"></td>
<td width="25%"></td>
<td width="25%"></td>
</tr>
<tr>
<td width="50%" class="total"><b>Total Deductions (Rs.) :</b></td>
<td width="25%" class="total"><b>' . $expected_deductions . '</b></td>
<td width="25%" class="total"><b>' . $deductions . '</b></td>
</tr>
</table>';
$net_earnings = $earnings - $deductions;
$net_salary = '<p style="font-size:20px!important"><b>Net Salary : Rs. ' . $net_earnings . '</b></p>';
$auto_text = '<p style="font-size:22px!important;color:#cccccc">This is a computer-generated salary slip. Does not require a Signature</p>';
$tcpdf->SetFillColor(155, 100, 0);
$tcpdf->writeHTMLCell(50, 0, '', 10, $header_html, 0, 1, 0, true, 'L', true);
$tcpdf->writeHTMLCell(50, 0, 55, 10, $header_html2, 0, 0, 0, true, 'R', true);
$tcpdf->writeHTMLCell(0, 0, '', 35, $payslip_date, 0, 1, 0, true, 'L', true);
$tcpdf->writeHTMLCell(80, 5, '', 40, $emp_name, 'LRTB', 1, 0, true, 'C', true);
$tcpdf->writeHTMLCell(80, 5, 85, 40, $employee_id, 'RTB', 1, 0, true, 'C', true);
$tcpdf->writeHTMLCell(80, 5, '', 45, $department, 'LRB', 1, 0, true, 'C', true);
$tcpdf->writeHTMLCell(80, 5, 85, 45, $designation, 'RB', 1, 0, true, 'C', true);
$tcpdf->writeHTMLCell(80, '', '', 55, $earnings_content, 'LRTB', 1, 0, true, 'C', true);
$tcpdf->writeHTMLCell(80, '', 85, 55, $deductions_content, 'RTB', 1, 0, true, 'C', true);
$tcpdf->writeHTMLCell(155, 3, '', '', $net_salary, 'LRTB', 1, 0, true, 'L', true);
$tcpdf->writeHTMLCell(155, '', '', 105, $auto_text, '', 1, 0, true, 'L', true);
// ...
// etc.
// see the TCPDF examples
$file_name = time() . '.pdf';
echo $tcpdf->Output($file_name, 'F');
//setting view variables before sending email so that if email is not sent generated salry slip will still be viewed
$this->set('salaryrecord', $this->request->data['SalaryRecord']);
$this->set('employee', $employee);
$this->set('earnings', $earnings);
$this->set('deductions', $deductions);
$this->set('expected_earnings', $expected_earnings);
$this->set('net_earnings', $net_earnings);
App::uses('CakeEmail', 'Network/Email');
$Email = new CakeEmail();
$Email->to($this->request->data['SalaryRecord']['email']);
$Email->bcc($se['User']['email']);
$Email->subject('Salary Slip of ' . $name . ' [ emp' . $this->request->data['SalaryRecord']['employee_id'] . ' ] for ' . $this->request->data['SalaryRecord']['salary_date']);
$Email->replyTo($se['User']['email']);
$Email->from($se['User']['email']);
$Email->emailFormat('html');
$Email->viewVars(array('salary_record' => $this->request->data['SalaryRecord']));
$Email->attachments($file_name);
$Email->template('salaryslip');
//$Email->send();
App::uses('File', 'Utility');
$file = new File($file_name);
$file->delete();
} else {
$this->set('salary_saved', 0);
}
}
}
}
示例15: sendEmail
public function sendEmail($receipient, $cc, $subject, $msg, $replyto)
{
$email = new CakeEmail('smtp');
$email->sendAs = 'text';
//FIXME(Balaji Kutty, 2012-05-25)
//Unable to get the template working with email. Fix it.
//$email->template = 'passwd_reset';
//$email->set('password', $str);
$email->delivery = 'smtp';
if ($replyto != null) {
$email->replyTo($replyto);
}
$email->subject($subject);
$email->to($receipient);
if ($cc != null) {
$email->cc($cc);
}
$email->helpers(array("Html"));
$email->template("default");
$email->emailFormat("html");
if ($email->send($msg)) {
return true;
}
}