<?php
-
/**
- * module: invite.php
+ * Module: invite.php
*
- * send email invitations to join social network
+ * Send email invitations to join social network
*
*/
-
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
-
-require_once('include/email.php');
+use Friendica\Protocol\Email;
function invite_post(App $a) {
}
- $recips = ((x($_POST,'recipients')) ? explode("\n",$_POST['recipients']) : array());
+ $recips = ((x($_POST,'recipients')) ? explode("\n",$_POST['recipients']) : []);
$message = ((x($_POST,'message')) ? notags(trim($_POST['message'])) : '');
$total = 0;
$nmessage = $message;
}
- $res = mail($recip, email_header_encode( t('Please join us on Friendica'),'UTF-8'),
+ $res = mail($recip, Email::encodeHeader(t('Please join us on Friendica'),'UTF-8'),
$nmessage,
"From: " . $a->user['email'] . "\n"
. 'Content-type: text/plain; charset=UTF-8' . "\n"
}
}
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$form_security_token' => get_form_security_token("send_invite"),
'$invite' => t('Send invitations'),
'$addr_text' => t('Enter email addresses, one per line:'),
. "\r\n" . "\r\n" . System::baseUrl() . '/profile/' . $a->user['nickname']
. "\r\n" . "\r\n" . t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n" ,
'$submit' => t('Submit')
- ));
+ ]);
return $o;
}