Commit 0aa177b1 authored by Tony Savorelli's avatar Tony Savorelli
Browse files

Fixes #1: Mail key "unsubscribe_confirm" pattern not recognized in _easynews_get_mail_key

parent 9a46d1ff
No related merge requests found
Showing with 7 additions and 2 deletions
+7 -2
......@@ -692,10 +692,15 @@ function easynews_mail($key, &$message, $params) {
* Extracts key and id (if present) from a dynamic mail key.
*/
function _easynews_get_mail_key($key) {
preg_match_all("/([a-z_]*)__(\d*)/", $key, $matches);
$allowed_keys = array(
'newsletter',
'unsubscribe_confirm',
);
$allowed_keys = implode('|', $allowed_keys);
preg_match_all("/({$allowed_keys})(__(\d*))?/", $key, $matches);
return array(
'key' => $matches[1][0],
'id' => $matches[2][0],
'id' => $matches[3][0],
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment