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(! valid_email($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'],
26 $message, "From: " . $a->user['email']);
31 notice( $recip . t(' : ') . t('Message delivery failed.') . EOL);
35 notice( $total . t(' messages sent.') . EOL);
40 function invite_content(&$a) {
42 notice( t('Permission denied.') . EOL);
46 $tpl = load_view_file('view/invite.tpl');
48 $o = replace_macros($tpl, array(
49 '$invite' => t('Send invitations'),
50 '$addr_text' => t('Enter email addresses, one per line:'),
51 '$msg_text' => t('Your message:'),
52 '$default_message' => t('Please join my social network on ') . $a->config['sitename'] . t("\r\n") . t("\r\n")
53 . t('To accept this invitation, please visit:') . t("\r\n") . t("\r\n") . $a->get_baseurl()
54 . t("\r\n") . t("\r\n") . t('Once you have registered, please make an introduction via my profile page at:')
55 . t("\r\n") . t("\r\n") . $a->get_baseurl() . '/profile/' . $a->user['nickname'] ,
56 '$submit' => t('Submit')