ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Custom member fields in member registration confirmation email

September 22, 2012 1:37pm

Subscribe [2]
  • #1 / Sep 22, 2012 1:37pm

    This question may be related to a resolved thread.

    The previous thread was “resolved” so I could not post in there. But I had the same issue with my site. I was able to hack in a simple solution, however.

    In mod.member_register.php in the register_member method towards the bottom after the $swap array is created, I added the following code:

    if ( isset($_POST) AND is_array($_POST) )
    {
     foreach ($_POST as $key => $value)
     {
      if ( stripos($key, 'm_field_id') === 0 )
      {
       $swap[$key] = $value;
      }
     }
    }

    This allows me to do something like this in my email notification template (Design › Message Pages › Email Notifications › Admin Notification of New Member Registration):

    First Name: {m_field_id_5}
    Last Name: {m_field_id_6}

    I’m sure this solution could be improved to use better template variables, but it will work for the time being. I hope this helps someone else.

  • #2 / Sep 24, 2012 10:52am

    Lisa Wess

    20502 posts

    Hey Victor!

    Thank you for the tip!

    I’m going to shift this to Community Help instead of resolving it, so that it can still be responded to.  Thank you again for posting the information!

  • #3 / Jan 03, 2014 7:32pm

    Trumpet

    19 posts

    I’m having issues getting this method to work.  Where exactly did you insert this code?

    Is there another way to do this without having to hack the core files? I would gladly pay for a module to do this, but i can’t find any.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases