Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // http://www.gravityhelp.com/forums/topic/collecting-email-addresses
- // shortcode usage: [submitted_emails form='FORMID']
- add_shortcode('submitted_emails', 'retrieve_emails');
- function retrieve_emails($emails) {
- $form_id = $emails['form'];
- // get all the field values for one form and one field ID
- $addresses = RGFormsModel::get_leads($form_id, 'CHANGE THIS TO YOUR EMAIL FIELD ID', 'ASC');
- // initialize the HTML we are going to return
- $html = "<ul class='email_addresses'>\n";
- // loop through all the leads
- foreach ($addresses as $email) {
- $html .= "\t<li>$email</li>\n";
- }
- $html .= '</ul>';
- // return the list
- return $html;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement