private function NewQuoteEmail(Customer $customer, Quotation $quote) { $data = array(); $data['customer'] = $customer; $data['quote'] = $quote; $mail = new PHPMailer(); $mail->isSMTP(); $mail->Host = 'truecloudmedia.co.uk'; $mail->SMTPAuth = true; $mail->Username = '******'; $mail->Password = '******'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom('*****@*****.**', 'Booth Garden Studios'); $mail->addAddress($customer->email); $mail->isHTML(true); $mail->Subject = 'Booth Garden Studios Quotation #' . $quote->id; $mail->Body = ' <p><img src="' . \Laravel\URL::to('/') . 'img/logo-booths-large.png" alt="Garden Booth Studios" /></p> <p>Thank you for completing a quotation with Garden Booths Studio.</p> <p>Your perfect studio came to £' . number_format($quote->price, 2) . '</p> <p>You can log into your account by <a href="' . action('quotations.sign_in') . '">clicking here</a> and using your email address and post code.</p> <p> <b>Email: </b> ' . $customer->email . '<br /> <b>Post Code: </b> ' . $quote->postcode . ' </p> <p>Or you can access your quote directly by clicking the below link.</p> <p><a href="' . action('quotations.my_quotes_load') . '/' . $quote->id . '?c=' . $quote->quick_access_code . '">' . action('quotations.my_quotes_load') . '/' . $quote->id . '?c=' . $quote->quick_access_code . '</a></p> <p>Garden Booth Studios</p> '; $mail->send(); }
/** * Create a redirect response. * * <code> * // Create a redirect response to a location within the application * return Redirect::to('user/profile'); * * // Create a redirect response with a 301 status code * return Redirect::to('user/profile', 301); * </code> * * @param string $url * @param int $status * @param bool $https * @return Redirect */ public static function to($url, $status = 302, $https = false) { return static::make('', $status)->header('Location', URL::to($url, $https)); }
public static function link($url, $title, $attributes = array(), $https = false) { $url = static::entities(URL::to($url, $https)); return '<a href="' . $url . '"' . static::attributes($attributes) . '>' . $title . '</a>'; }
/** * Extended to pass URLs through Laravel. * * @internal * @param array $matches * @return string * @uses Laravel\URL::to() */ function _doAnchors_inline_callback($matches) { $link_text = $this->runSpanGamut($matches[2]); $url = $matches[3] == '' ? $matches[4] : $matches[3]; $title = isset($matches[7]) ? $matches[7] : null; $url = $this->encodeAttribute($url); // BEGIN: Modification to pass URLs through Laravel if ($url[0] !== '#' and is_null(parse_url($url, PHP_URL_SCHEME))) { $url = \Laravel\URL::to($url); } // END $result = "<a href=\"{$url}\""; if (isset($title)) { $title = $this->encodeAttribute($title); $result .= " title=\"{$title}\""; } $link_text = $this->runSpanGamut($link_text); $result .= ">{$link_text}</a>"; return $this->hashPart($result); }
/** * Determine the appropriate action parameter to use for a form. * * If no action is specified, the current request URI will be used. * * @param string $action * @param bool $https * @return string */ protected static function action($action, $https) { $uri = is_null($action) ? URI::current() : $action; return HTML::entities(URL::to($uri, $https)); }
public static function url($url) { $url = trim($url, '/'); return URL::to(static::handle() . '/' . $url); }
public static function to_language($language, $reset = false) { $url = $reset ? URL::home() : URL::to(URI::current()); if (!in_array($language, Config::get('application.languages'))) { return $url; } $from = '/' . Config::get('application.language') . '/'; $to = '/' . $language . '/'; return str_replace($from, $to, $url); }
/** * Get the URL to switch language, keeping the current page or not * * @param string $language The new language * @param boolean $reset Whether navigation should be reset * @return string An URL */ public static function to_language($language, $reset = false) { // Get the url to use as base $url = $reset ? URL::home() : URL::to(URI::current()); // Validate the language if (!in_array($language, Config::get('application.languages'))) { return $url; } // Get the language we're switching from and the one we're going to $from = '/' . Config::get('application.language') . '/'; $to = '/' . $language . '/'; return str_replace($from, $to, $url); }