Can anyone help with this? I need to add a few lines to register.php in order to send an email from the email address supplied by a new member to another email address (our newsletter provider) but I'm struggling to understand the order of paramaters I need to supply to send_mail. I see the following two example in register.php:
but all I really need to do is send a mail from the user's email address to the subscribe address supplied by our newsletter host, I don't necessarily need to include a subject or body but perhaps doing so would be wise to avoid spam filters. I can assign the user's address to $from but I guess the biggest thing I'm struggling with is where to include the To: address in the list of values passed to send_mail? Any help much appreciated, thank you!
Excellent, many thanks DJ, that's just what I was looking for. I understand from the argument decriptions that $message is basically the body/content of the message but I haven't quite understood what $mailer_message is or does (perhaps because I'm not a programmer) - do I need to worry about it in this context or just include it as it's mandatory? Does it just return a sort of of success/failure message which can, if desired, be echoed to the screen?
Hi DJ, one last question? Is there any way to suppress $from_name completely so that only the email address (i.e. $from) appears in the From: line of the message header? I've tried setting $from_name = "" but the default value of the sitename is still included in the outgoing mail. Many thanks in advance.
Many thanks. It didn't quite work, producing a From name of " \n", so I changed it to just "\r" and that seems to have done the trick (strictly speaking there does still seem to be a blank character in the From line before the email address but it's not appearing in quote marks and my mail client is showing the email address as the From value in my inbox screen so I don't think it matters).
Aaargh, so near to getting this finished but discovered one final issue!
I've set "Receive Newsletter" to "Hidden" via the Members Config -> Fields admin screen because I've replaced the newsletter sign up code in register.php with my own (to allow subscription to our third party newsletter provider via email as above) but I've noticed that Receive Newsletter is still a configurable field visible to the user on the My Preferences screen when they log in. I had imagined that this line would disappear having changed the setting to invisible. I'm going to start digging around to see if I can find a work out how to replace that line with something else (e.g. instructions to the member on how to unsubscribe from our third party newsletter) but if anyone can point me to the right place it would, as always, be appreciated.
Certainly it looks as though that's the way it works and I can't see any way to turn the DF newsletter off completely so that a member's subscription status doesn't appear on their preferences screen. I'm out of the office at the moment but when I get back later I'll start looking to see if a little editing of the existing code can get round this, in the meantime would you happen to know off the top of your head where I should be looking (i.e. for the code which displays the user preferences screen)?
That is the way it works. Always forget that and make same mistake!
Really want a Disable option. But that means a change to Admin configuration to offer Disable, plus change to My Profile to not display if disabled, and ditto to at least Registration, perhaps more. (And might break AccountPlus?)
How about a test to see if Newsletter module is present and ignore field if not?
so that the Yes/No line on the preferences screeen isn't explicitly associated with the newsletter, although admittedly it'll now look a bit odd without an explanation as to what the Yes/No setting refers to. I just can't see which function is being called to output that entire screen in the first place though!