FoxSecrets
Active member
I am implementing a function to send email to the user and I got some questions regarding that:
1) How to find forum user according to the username from specific table. How to make this comparison?
2) What are the parameters of setTemplate? Can I send more than one parameter to template ? Any related documentation?
1) How to find forum user according to the username from specific table. How to make this comparison?
2) What are the parameters of setTemplate? Can I send more than one parameter to template ? Any related documentation?
Code:
public function actionSendEmail(ParameterBag $params)
{
$purchase = $this->assertPurchaseExists($params->license_id);
$mail = \XF::app()->mailer()->newMail();
$username = $purchase->user_name;
$user = \XF::app()->find('XF:User', $member->username == $username );
$mail->setToUser($user);
$mail->setTemplate('my_email_template', [
'purchase' => $purchase
]);
$mail->queue();
}
Last edited: