4 function invite_post(&$a) {
6 notice( t('Permission denied.') . EOL);
11 $recips = explode("\n",$_POST['recipients']);
12 $message = $_POST['message'];
16 foreach($recips as $recip) {
18 $recip = trim($recip);
20 if(!eregi('[A-Za-z0-9._%-]+@[A-Za-z0-9._%-]+\.[A-Za-z]{2,6}', $recip)) {
21 notice( $recip . t(' : ') . t('Not a valid email address.') . EOL);
25 $res = mail($recip, t('Please join my network on ') . $a->config['sitename'], $message, "From: " . $a->user['email']);
30 notice( $recip . t(' : ') . t('Message delivery failed.') . EOL);
34 notice( $total . t(' messages sent.') . EOL);
39 function invite_content(&$a) {
41 notice( t('Permission denied.') . EOL);
45 $tpl = load_view_file('view/invite.tpl');
47 $o = replace_macros($tpl, array(
48 '$invite' => t('Send invitations'),
49 '$addr_text' => t('Enter email addresses, one per line:'),
50 '$msg_text' => t('Your message:'),
51 '$default_message' => t('Please join my social network on ') . $a->config['sitename'] . t("\r\n") . t("\r\n")
52 . t('To accept this invitation, please visit:') . t("\r\n") . t("\r\n") . $a->get_baseurl()
53 . t("\r\n") . t("\r\n") . t('Once you have registered, please make an introduction via my profile page at:')
54 . t("\r\n") . t("\r\n") . $a->get_baseurl() . '/profile/' . $a->user['nickname'] ,
55 '$submit' => t('Submit')