User's email address in community event submissions

Home Forums Calendar Products Community Events User's email address in community event submissions

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #588845
    kellymarie2001
    Participant

    Hi there,
    We need to be able to contact by email any user that submits an event via our community events plugin. The only way to do this, it seems, is to track down the user’s profile (then find the email from there) registered under the User section in our dashboard. Nowhere else does it tell you the email address of the user that just submitted an event for approval.
    Is there a way to customize the email notification being sent to one of our admins, so that it contains the username and email address of the person who just submitted that event for approval? Would make our lives a whole lot easier!
    Thanks in advance!

    #597523
    Barry
    Member

    Yes, you should be able to customize that email. Our Themer’s Guide covers the basics in terms of safely overriding templates and the actual template you will be interested in here is community/email-template.php. Within that, try adding a bit of code like this:

    <p>
    	This submission came from:
    	<?php esc_html_e( get_user_by( 'id', $post->post_author )->user_email ) ?>
    </p>

    Does that help?

    #675020
    kellymarie2001
    Participant

    Tried that, no dice. The email we receive shows:

    Test4
    August 15 – August 15

    Event Organizer
    (name here)
    Event Venue
    (venue name here)

    Description
    test

    Review Event

    I followed the directions, tried placing the code in multiple locations – no luck.

    #675500
    Barry
    Member

    OK, so you don’t even see the text reading “this submission came from”? Can you show me your custom template code (ideally via Pastebin, Gist or some similar service) and could you also tell me the filepath you have placed it at?

     

    #675531
    kellymarie2001
    Participant

    Hi Barry!
    Here’s the latest code I was trying out (using the email-template.php): http://pastebin.com/VYL6dh4a
    I’ve uploaded it to both /themes/flatsome/tribe-events/community/email-template.php
    and /plugins/the-events-calendar-community-events/views/community/ for good measure (when it wasn’t working).

    Thanks!

    #680853
    Barry
    Member

    OK, so the filepath for your custom template looks good to me but I do see an error in your code. If you look at lines 45-47 there is whitespace (a couple of extra line breaks in this case) breaking the -> operator in to two pieces.

    If you look at the code I shared, though, you’ll see that is all on one line. Can you review that and amend it, unless it’s simply a by-product of copying and pasting across to Pastebin?

    As per my last reply, I am a bit surprised though that you didn’t at least see some text reading, “This submission came from:” even if the insertion of the email address is broken due to the above. Can you confirm you literally saw no change there?

    and /plugins/the-events-calendar-community-events/views/community/ for good measure (when it wasn’t working).

    We never recommend editing core code in this way, but out of interest were you able to effect changes to the template here that were visible in the actual emails?

    #681711
    kellymarie2001
    Participant

    It looks like it was just the way it pasted into pastebin and I wasn’t paying attention – the line breaks don’t exist in the actual file. Here’s a revision: http://pastebin.com/c3i717Hu

    I literally saw no change. Just to test things further, I removed the entire Description area and posted a test event – the email I received with the submission information saw zero change (in other words, the Description area that I erased is still there).

    It seems like we’re in the wrong place?

    #683548
    Barry
    Member

    Yes, either you are in the wrong place – though based on what you are showing to me it looks like you’ve got the correct path – or, if when you attempted to make a change to the core plugin template you also see zero change, it’s not impossible that this is the result of poorly configured opcode caching (where instead of reading and interpreting each PHP file afresh every time WordPress runs it “saves a snapshot” of the code in memory – but perhaps here that snapshot isn’t being cleared out, or invalidated, at the appropriate point).

    Perhaps you could confirm if opcode/bytecode caching is enabled by checking in with your webhost?

    On the other hand, if you find that you can make a change by directly editing the core plugin template (even though of course we don’t recommend this as a long term strategy) then it’s probable that you aren’t getting the template override path quite right … I’m not quite sure why that would be unless you’re setting this up within the wrong theme directory.

    Quite puzzling.

     

    #685191
    kellymarie2001
    Participant

    As mentioned previously, I did replace the core plugin file under /plugins/the-events-calendar-community-events/views/community/

    No change.

    I’m on a multisite – does that make a difference?

    We need to figure out asap how to get the information of the person submitting each event so that we can contact them directly – this does seem to be an oversight on the plugin’s capabilities (at least have a field in the submission area that includes an email address that won’t be published?).

    I’ll contact the host as well but they aren’t very helpful!

    #686171
    Barry
    Member

    I’m on a multisite – does that make a difference?

    I don’t believe this would create a problem and, on running a quick test, I could achieve the same thing as on a regular site (ie, create a template override and customize the email).

    As mentioned previously, I did replace the core plugin file under /plugins/the-events-calendar-community-events/views/community/

    No change.

    OK, thanks for clarifying.

    In that case – if you are not seeing any changes when modifying the core template, nor when you set up a template override – something else is likely at play here as discussed in my last reply and I’m afraid that, regrettably, it doesn’t sound like a situation where we can do much more to help you. You are likely to need the assistance of your web host or a developer to see this one through.

    #723532
    Barry
    Member

    Hi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘User's email address in community event submissions’ is closed to new replies.