Main Menu
collapse

Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

User Info

Welcome Guest.
Please log in.

Who's Online

  • Dot Guests: 1134
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]


If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Help Capturing Additional Info

Started by jjwinc, January 29, 2011, 07:08:24 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

jjwinc

One site that I have created can be used by members and non-members alike; and they would like me to add a block to the landing page that can quickly gather the users email address and/or cellular number to be used to inform them of site updates via email/text.  I've done quite a bit of searching here and on SMF, but either I'm searching for the wrong terms, or it just doesn't exist as a mod or block.

Is there a way to add a text box or two along with a submit button that would capture the information to a new table and/or email the information to a particular address?  I know the functionality is at the core of SMF/SP, but how do we leverage that functionality for custom use?

Are there maybe wiki's on how to create a db table and manipulate the information via a block or custom code?  Any help or direction would be greatly appreciated.

AngelinaBelle

You can certainly use custom profile fields to hold additional member information.
After that, you'd have to write some code to actually make use of that information.

But you have website followers who DO NOT WANT TO REGISTER but WANT you to send them email and text? So anybody can just enter an email or phone # and get your updates sent to, well, anybody in the world?  You want an email list for that.  You aren't going to find that at SMF, but there are plenty of free ones out there, at least for email.

Once you've got it working, you can even put it in a SimplePortal block.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

jjwinc

Thank you for the reply.  Yes, that's exactly what they want.  The site is a transit union website and they want to be able to capture both union members and riders (i.e.; customers) email addresses and/or cell numbers for "call to action" type blasts.  I tried leading them in the direction of twitter (because that's what twitter does best), but they want this instead <shrug>.

I know SMF (and SP) both use sendmail.  Would it be possible to mock up a simple HTML form with the PHP code to send the results via sendmail?  Has anyone ever done this?  For example, I see the following code in ManageMembers.php (this particular block is for sending email for activated users):

$replacements = array(
'USERNAME' => $member['name'],
'ACTIVATIONLINK' => $scripturl . '?action=activate;u=' . $member['id'] . ';code=' . $validation_code,
'ACTIVATIONLINKWITHOUTCODE' => $scripturl . '?action=activate;u=' . $member['id'],
'ACTIVATIONCODE' => $validation_code,
);

$emaildata = loadEmailTemplate('admin_approve_activation', $replacements, $member['language']);
sendmail($member['email'], $emaildata['subject'], $emaildata['body'], null, null, false, 0);
}
}


Obviously, I'm most interested in the sendmail line at the end.  What would I need to change in order to use my form blocks instead of pulling from the db?  Is this just standard PHP sendmail?  Can I just google it for examples or are there special rules to follow?




AngelinaBelle

Did you say you wanted to be able to send email to people who are not registered members of the forum?
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

jjwinc

Actually, we're simply gathering email addresses and/or cell phone numbers for the purposes of email blasts.  So I'm not interested in storing this information in a database anywhere, I simply want to take the contents of the message that is generated and mail it off to someone who is building a mailing list.


jjwinc

I realized that I didn't answer your question.  Yes, we are interested, ultimately, in capturing members and non-members email addresses and/or cell phone numbers for the purposes of sending them out notices.  BUT, we're not looking to email non-members from within SMF/SP, but rather send their name/cell to another email address so they can manually build a mailing list.

AngelinaBelle

Have you considered free mailing list software like Subscribe Me Lite, and other similar packages?
You install the cgi, you put a tiny (two-line )form in a block on your portal, the email list just works.
Very little hassle for you -- nothing to build.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

jjwinc

Just wanted to give an update here.  I ended up going with NateMail, which just takes the information from a form and mails it to an address of your choosing.  I picked NateMail because it's a little more secure than other mail programs. 

The only thing I can not seem to do cleanly is have the "thank you" redirect page show up inside of the block that called the mail script.  Is this even possible? 

Even still, it's working perfectly, I just have the redirect link back to the main page and all

AngelinaBelle

Having the redirect show up in the same block would be awfully tricky, when you think about it, if you are passing the login information to an external CGI.

If it is just a generic "thank-you" page, I suppose that would be possible -- if you can tell your email software a specific URL, the block code could look for an extra parameter in the URL and decide to show the thank-you page.
Your solution gets you 80% of the way there, though, and is easier.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

jjwinc

I suppose I will tackle that when I have a bit more time.  80% there plus the path of least resistance equals a happy man (at least for me).      :)

Thank you for the help.  As always, it's greatly appreciated.