function tnb_envia_email_pagamento($type, $evento_id, $artista_id = null) { $op = get_option('emails_pagamento'); $evento = get_post($evento_id); $produtor = get_user_by('id', $evento->post_author); $artista = $artista_id ? get_user_by('id', $artista_id) : null; foreach ($op[$type] as $utype => $email) { $title = nl2br(stripslashes(pagamento_substitui_substituicoes($email['title'], $evento_id, null, null, $artista))); $message = nl2br(stripslashes(pagamento_substitui_substituicoes($email['message'], $evento_id, null, null, $artista))); if ($utype == 'editor') { $address = $op['email_editor']; } // TODO: substituir if ($utype == 'produtor') { $address = $produtor->user_email; } if ($utype == 'artista' && $artista) { $address = $artista->user_email; } $headers = array('Content-type: text/html'); wp_mail($address, $title, $message, $headers); } }
function get_contrato_inscricao_substituido($evento_id, $valor, $porcentagem, $contrato) { $result = pagamento_substitui_substituicoes($contrato, $evento_id, $valor, $porcentagem); return $result; }