本文整理汇总了PHP中EmailTemplate::find方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailTemplate::find方法的具体用法?PHP EmailTemplate::find怎么用?PHP EmailTemplate::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmailTemplate
的用法示例。
在下文中一共展示了EmailTemplate::find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showEmail
public function showEmail($templateid, $contactid)
{
$contact = Contact::find($contactid);
$template = EmailTemplate::find($templateid);
$urlEmail = $template->html_body;
$emailtemplate = Emailtemplate::findOrFail($id);
return View::make('emails.templates.default', compact('emailtemplate'));
return View::make('users.showemail')->with('contact', $contact)->with('urlEmail', $urlEmail);
}
示例2: sendmail
private static function sendmail($memberid, $contactid, $templateid)
{
$data['member'] = User::findOrFail($memberid);
$contact = Contact::findOrFail($contactid);
$data['contact'] = $contact;
$data['idencrypted'] = $contact->encryptContact();
$data['emailtemplate'] = EmailTemplate::find($templateid);
$template = 'emails.templates.default';
Mail::send($template, $data, function ($message) use($data) {
$message->to($data['contact']->email, $data['contact']->full_name)->subject($data['emailtemplate']->subject);
});
if (count(Mail::failures()) > 0) {
return false;
} else {
return true;
}
}
示例3: edit
/**
* Show the form for editing the specified emailtemplate.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$emailtemplate = EmailTemplate::find($id);
return View::make('email_templates.edit', compact('emailtemplate'));
}
示例4: __sendNewRegistrationEmail
private function __sendNewRegistrationEmail(Entry $entry, array $fields = array())
{
if (!($role = $this->fetchRole($entry->getData($this->roleField(), true)->role_id))) {
return;
}
$email_template = EmailTemplate::find($role->id() == self::INACTIVE_ROLE_ID ? 'activate-account' : 'welcome', $role->id());
$member_field_handle = $this->usernameAndPasswordFieldHandle();
return $email_template->send($entry->get('id'), array('root' => URL, "{$member_field_handle}::plaintext-password" => $fields[$member_field_handle]['password'], "{$member_field_handle}::username" => $fields[$member_field_handle]['username'], 'code' => $this->generateCode($entry->get('id')), 'site-name' => Symphony::Configuration()->get('sitename', 'general')));
}