• Resolved dkijc

    (@dkijc)


    Hi! FIrst of all, thank you so much for the great plugin! I am very very new to wordpress and I wanted to just extend your code outside of what’s available ??

    I am creating a registration page for an event. I want to send a confirmation email after the user submits the form.

    I added add_action('new_registrant', array($this, func_to_send_email())); in the bnfw.php file. (I also created a new dropdown menu specific to my registration. Added a new notification type ‘register-new-attendee’.. )

    Then I tried integrating with the new hook by calling do_action('new_registrant') from my template.. I was seeing errors before, complaining I was sending the wrong #of args but I believe all that is fixed now and I don’t see any errors in the log.

    But still no emails are getting sent. ?? And I don’t know how to debug like javascript (eg. console.log).

    I tried print_r() and echo, as we well as setting WP_DEBUG to be true. And no luck.

    Any help would be soo appreciate it! TY!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author bnfw

    (@voltronik)

    Hi @dkijc,
    Thanks for your message.

    You may find it easier to go about it a slightly different way, such as in this example.
    Whilst this is for ACF Pro’s front-end forms, you may find it a useful starting place for you, rather than editing the core BNFW plugin.

    Let me know if this helps or if you have any questions.

    Thread Starter dkijc

    (@dkijc)

    Thank you for the reply!

    I didn’t want to modify your core code either.. But I don’t think pro feature is what I can afford at the moment :(..

    I had it working once (tho error was being thrown saying parameter isn’t the correct number)… So I don’t want to give up! hahah.

    Checked the db and it seems like all my values are properly being set in the posts/postsmeta db. (post_type is ‘bnfw_notification’)

    I see that your add_actions are being registered during your construct. Do I have to do something more to “register” the action?

    I guess this isn’t your plugin related but what’s the best way to debug?

    Thank you so much in advance.

    Plugin Author bnfw

    (@voltronik)

    Hi @dkijc,
    Just to clarify: I wasn’t suggesting purchasing anything, just suggesting that the above linked article may help you with your code so that you didn’t have to modify the core plugin.

    Please take a look at the link above and see if it helps you – you shouldn’t need to purchase anything in order to get it working. Unfortunately, I can’t provide a level of support where I help you debug custom functionality or code.

    Plugin Author bnfw

    (@voltronik)

    Closing due to inactivity. If you need further help with this, please feel free to re-open this thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘add_action()’ is closed to new replies.