Here's what I got so far:
I have a custom field set up in the usercp under General Settings as shown in the attached image.
I was planning to have a field in my mod configuration screen where the field name of the custom user field would go so I know where to pull info from.
Then on the sent email I was planning to include an unsubscribe url like:
Code:
mydomain.com/reminderemails.php?do=unsubscribe&email=johnsmith@somedomain.com
I wanted to set a field in the vb_user table to indicate they unregistered but then I realized I also needed to programmatically change the value in the userfields table so the custom field value in the usercp would reflect the optout.
I saw in the profile.php script where the set_userfields method in the userdata object to set the custom fields like so:
PHP Code:
// custom profile fields
$userdata->set_userfields($vbulletin->GPC['userfield']);
I also googled set_userfields and found in the vb.org archives that I should be able to use this method to set a specific custom field:
PHP Code:
// change ## to the number of the custom field,
// and fieldvalue to the value you want
$fieldvariable = array('field##' => "fieldvalue");
$userdata->set_userfields($fieldvariable, true, 'admin');
I'm not sure what the other parameters do though. I guess my question is does this sound like a viable solution or would there be a better way? Is there any way to use numeric values for the data in the table? The drawback to using a custom field is that I don't have any control of it programmatically. If there was a template hook where I could insert a custom template at the end of the General Settings template using a plugin that might work.
Sorry if I'm rambling... just trying to provide as much information as I can.
Anyone got any thoughts on this?