Answer the question
In order to leave comments, you need to log in
How to send password reset email via MODX Revo API?
Good day!
How do I reset my password via the MODX Revo API so that an email with a reset link is sent properly?
I tried to run such a snippet, but no letter is generated (?) and does not fall on the mail.
<?php
define('MODX_API_MODE', true);
require 'index.php';
....
$output = $modx->runSnippet('ForgotPassword',array(
'username' => '[email protected]',
'emailTpl' => 'lgnActivateEmailTpl',
...
));
Answer the question
In order to leave comments, you need to log in
While using this crutch:
function fsock_post_async($url, $params)
{
foreach ($params as $key => &$val) {
if (is_array($val)) $val = implode(',', $val);
$post_params[] = $key.'='.urlencode($val);
}
$post_string = implode('&', $post_params);
$parts=parse_url($url);
$fp = fsockopen($parts['host'],
isset($parts['port'])?$parts['port']:80,
$errno, $errstr, 30);
$out = "POST ".$parts['path']." HTTP/1.1\r\n";
$out.= "Host: ".$parts['host']."\r\n";
$out.= "Content-Type: application/x-www-form-urlencoded\r\n";
$out.= "Content-Length: ".strlen($post_string)."\r\n";
$out.= "Connection: Close\r\n\r\n";
if (isset($post_string)) $out.= $post_string;
fwrite($fp, $out);
fclose($fp);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question