Ok. I have installed the Usergroups Mod. I want to email a usergroup much like with the "Email All Users" mod, but only to certain usergroups. I took the "Email All Usergroups" mod and tried to alter the SQL Statement. I used a JOIN for the MEMBERS and USERGROUP_USERS tables. The way I have it here:
www.jbaldwin.net/misc/admin_mail_usergroups1.txt
I get this error:
Code:
SELECT FORUM_MEMBERS.*, FORUM_USERGROUP_USERS.* FROM FORUM_MEMBERS LEFT JOIN FORUM_USERGROUP_USERS ON FORUM_MEMBERS.MEMBER_ID=FORUM_USERGROUP_USERS.MEMBER_ID WHERE FORUM_MEMBERS.M_STATUS = 1 AND FORUM_MEMBERS.M_RECEIVE_EMAIL = 1 AND FORUM_USERGROUP_USERS.USERGROUP_ID = 2
Sending E-Mail
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "Demo"]'
/forum/forum2/admin_pop_mail_usergroups.asp, line 128
It is caused by this section in the code:
Code:
Select Case Member_Level
Case 1
strMessage = strMessage & "a member of usergroup 1 "
Case 2
strMessage = strMessage & "a member of usergroup 2 "
End Select
Now, if I comment out that section, it says it sends the email, however, I do not receive an EMAIL?? I am hoping this is something simple, but I honestly have no idea....LOL :
Code:
SELECT FORUM_MEMBERS.*, FORUM_USERGROUP_USERS.* FROM FORUM_MEMBERS LEFT JOIN FORUM_USERGROUP_USERS ON FORUM_MEMBERS.MEMBER_ID=FORUM_USERGROUP_USERS.MEMBER_ID WHERE FORUM_MEMBERS.M_STATUS = 1 AND FORUM_MEMBERS.M_RECEIVE_EMAIL = 1 AND FORUM_USERGROUP_USERS.USERGROUP_ID = 2
Sending E-Mail
Sent 1 E-Mail
Close Window
...and to further add to my confusion, if I add a Response.Write to see what the variables are that the SQL is pulling:
Code:
Response.Write Member_Name & " --- " & Member_Email & " --- " & Usergroup_ID & "<hr>"
It is pulling out some odd variables, it looks like it is only pulling data from the USERGROUPS_ID table.
Code:
Sending E-Mail
797 (this is actually Member ID) --- 1 (this could be Status, level or...) --- Demo (this is the Member Name)------------------------------------------------
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "Demo"]'
/forum/forum2/admin_pop_mail_usergroups.asp, line 131
Have I thoroughly confused everyone here? I know I've confused myself for SURE! LOL. Put a fork in me, I'm done.
<