User Informations in admin email notification
This topic contains 6 replies, has 3 voices, and was last updated by Alex Rollin 6 years, 10 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: admin, email, form, notification, register
-
AuthorPosts
-
January 3, 2018 at 10:34 am #1244
Hi there,
Regular there is that [#extras#] variable, which displays the default fields (in my case, I use only Name and emailadress) of the newly registrated user in the admin notification email.
But Id’ like to display custom values/fields of the registration form in this email as well.
Specifically, do I have a additional Text-field and a phonenumber-field I created.I couldn’t find out, where I could add those two fields to the variable. And would be very great full for help.
Some Information:
>I got some basic knowledge in coding but im far away from Pro in my opinion.
>The PlugIn is used on a swissgerman Site, so I translated parts of the PlugIn to German (only displaying strings, no variables or such)
>I saw in the PlugIn Files some criterias, from the Query I thought would pull the Information and I think the settings are correct. (I got some Screenshots from the two Fields)Thank you in advance
January 3, 2018 at 2:23 pm #1253Hello!
Some improvements were made by adding email tags in the past:
https://userswp.io/support/topic/feature-request-more-tags-for-emails/I know we won’t be adding more tags right now, but Let me check with the team to see if we can find out more.
Thank you for your patience while we look into this.January 3, 2018 at 2:32 pm #1255Hello,
You would need to use a filter to add the info, not tested but something like this(this will show all info available):
add_filter('uwp_send_admin_mail_extras', '_my_admin_mail_extras', 15, 3); function _my_admin_mail_extras($extras, $type, $user_id) { switch ($type) { case "register_admin": $usermeta = uwp_get_usermeta_row($user_id); $extras .= "<p>".print_r($usermeta,true)."</p>"; } return $extras; }
Thanks,
Stiofan
January 4, 2018 at 2:33 pm #1261Thank you for that fast replies!
I couldn’t found what I search in the email tag post. Though I really would be happy if I could make a Tag like [#phonenumber#]. That was the first thought I had. If I could understand the way, the other tags are made, I could make my own, perhaps with the field ID. (Im more used to JS than to PHP) When I didn’t made it work, I thought, I could try to manipulate an existing tag. Which seems to be out of my knowledge as well. 🙁
At least I wasn’t totally wrong with the filters, as it seems with the solution from Stiofan OConnor, that’s the way to do it.
How ever, I think I don’t get it wright, because it seems, that I don’t understand, where to put the filter.
Now, how I understud it:
I have to find the definition of the the default variable[#extras#]
which is basically
$extras
in the code.
And I found this:
$extras = apply_filters('uwp_send_mail_extras', "", $message_type, $user_id);
The queries I found, seemed to be the wrong ones. And I don’t find in the PHP files a other definition of
$extras
, nor a filter or query, I could connect to this definition. So I thought, I had to put a code like the one from Stiofan OConnor either after the equal sign or in to the brackets. But obviously that’s a wrong thought.
Where do I have to put the
add_filter(...)
code.
Ususal I try to figure out such stuff more by my self. But I some how really don’t get it and I’m running out of time a bit. So I really appreciate your Help.
Thank you and for your patience.
January 4, 2018 at 4:41 pm #1262Hello!
Above, Stiofan provided a Snippet, which you can use with the “Code Snippets” plugin.
https://wpgeodirectory.com/docs/useful-plugins/#snippets
You may need to customize that further, so let us know how it goes
January 16, 2018 at 2:56 pm #1344Hello,
Just to close this. I tried it and failed horribly. XD
Because I ran out of time, I hired a more experienced Programmer who created a new Mail Tag from scratch.I just wanted to thank for the help, regardless. I may could have done it, with more experience.
Thanks!
January 16, 2018 at 8:54 pm #1345Hello Dominik,
thanks for writing in to let us know.
Can you share how you went about this? Code samples?
Thanks again for letting us know
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket