Return to Snippet

Revision: 36046
at November 17, 2010 05:24 by joaobarbosa


Initial Code
################################################################
# Adicionar este código dentro da função __trigger() do evento #
################################################################

# Pega os campos vindo via POST
$fields = $_POST['fields'];

# Monta o corpo da mensagem
$message  = "Nome: "     .$fields['nome']    ."
";
$message .= "Email: "    .$fields['email']   ."
";
$message .= "Empresa: "  .$fields['empresa'] ."
";
$message .= "Telefone: " .$fields['telefone']."
";
$message .= "Mensagem: " .$fields['mensagem']."
";

# Array com as configurações do email
$email = array();
$email['to_email']   = '[email protected]';
$email['from_email'] = '[email protected]';
$email['from_name']  = $fields['nome'];
$email['subject']    = 'Assunto';
$email['message']    = General::sanitize(trim($message));
$email['headers']    = array('Content-Type' => 'text/plain; charset=UTF-8');

## Send it!
if (!General::sendEmail($email['to_email'], $email['from_email'], $email['from_name'], $email['subject'], $email['message'], $email['headers'])){
	Frontend::instance()->Log->pushToLog("Email were not sent.", Log::kERROR, true);
}

Initial URL

                                

Initial Description

                                

Initial Title
Enviar Email Em Evento Personalizado

Initial Tags

                                

Initial Language
PHP