Lukas W.
Well-known member
Hey,
I'm currently trying to figure out how to optout custom alert based on user preferences, but it isn't working for some reason...
My profile field in the alert preferences looks like to following:
The content type in the database is ResourceToRPG.
I'm sending the alert with the following code:
The setting is stored in the database correctly, but the user receives the alert no matter if he decided to opt it out or not... Any ideas?
I'm currently trying to figure out how to optout custom alert based on user preferences, but it isn't working for some reason...
My profile field in the alert preferences looks like to following:
HTML:
<li><input type="hidden" name="alertSet[ResourceToRPG_invite]" value="1" />
<label><input type="checkbox" value="1" name="alert[ResourceToRPG_invite]" {xen:checked "!{$alertOptOuts.ResourceToRPG_invite}"} /> {xen:phrase RTR_rpg_invitation}</label>
<p class="hint">{xen:phrase RTR_adds_you_to_rpg}</p>
</li>
The content type in the database is ResourceToRPG.
I'm sending the alert with the following code:
PHP:
XenForo_Model_Alert::alert(
$user,
$visitor->getUserID(),
$visitor->toArray()['username'],
'ResourceToRPG',
$resource['resource_id'],
'invite'
);
The setting is stored in the database correctly, but the user receives the alert no matter if he decided to opt it out or not... Any ideas?