• Resolved Sean Nicholson

    (@seanrnicholson)


    We are using the free version of the plugin. We created pdf versions of our blog posts and added them to our site in a specific directory (example below). We wanted to add a link to that PDF to be included in the comment notifier.

    Our notification is set to trigger on “New Comment Awaiting Moderation”. The body of our message is as follows:

    A new comment on the post “[post_title]” is awaiting your approval:
    [permalink]
    Author: [comment_author] (IP address: [comment_author_IP])
    Email: [comment_author_email]
    URL: [comment_author_url]
    Comment:
    [comment_content]

    This works great. What we want to do, however, is add the link to our PDF. The URL to the pdf is [global_site_url]/blog-post-pdfs/[postslug].pdf. So an example of one can be seen on our staging site at:

    https://birlacarbon.staging.wpengine.com/blog-post-pdfs/instrumental-measurement-of-deep-black-coatings.pdf

    The problem occurs when we add the following text to our email.

    You can review a PDF version of this post here:
    [global_site_url]/blog-post-pdfs/[post_slug].pdf

    When we do that. No emails are ever sent. The notification just stops working. When we remove those two lines of text/shortcodes then the emails send again just fine.

    Any ideas why this is happening?

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

    (@voltronik)

    Hi @seanrnicholson,
    It sounds like either a bug in BNFW or the particular URL is causing a spam filter to trigger somewhere.

    What you can do, is build a custom shortcode using the information you want so you can add this directly to the notification. You can see how to do this, with an example, here: https://betternotificationsforwp.com/documentation/adding-custom-shortcodes/

    Thread Starter Sean Nicholson

    (@seanrnicholson)

    I would really like to just use the shortcodes that are included in the plugin. Is there a way to test/resolve this beyond creating a custom shortcode?

    I just hardcoded the exact URL into a message and it sent just fine, so no spam filter caused any issue. It’s likely a bug in the plugin.

    Let me know what info I can provide to help troubleshoot/resolve.

    Thanks!

    Thread Starter Sean Nicholson

    (@seanrnicholson)

    I did some further testing by just adding the shortcodes and info one by one and testing where it breaks:

    [global_site_url] – Just this works just fine and the notification sends
    [global_site_url]/blog-post-pdfs/ – adding the directory work and the notification sends
    [global_site_url]/blog-post-pdfs/[post_slug] – adding the slug shortcode works.
    [global_site_url]/blog-post-pdfs/[post_slug].pdf – This does NOT work. When I append .pdf to the end of the line, the notification does not send.

    Any ideas why this might be?

    Plugin Author bnfw

    (@voltronik)

    Hi @seanrnicholson,
    I don’t know why this might be. I can investigate but it does sound like some kind of security measure within WordPress, possible something to do with escaping certain characters or characters in an order, when the shortcodes are rendered.

    Leave it with me and i’ll see what I can find out.

    Thread Starter Sean Nicholson

    (@seanrnicholson)

    Thanks. If you need any help on my end, I’m glad to assist.

    Thread Starter Sean Nicholson

    (@seanrnicholson)

    Any updates on testing this?

    Plugin Author bnfw

    (@voltronik)

    Hi @seanrnicholson,
    Nothing as yet. Currently working through a backlog of small bugs.

    I will let you know if I find anything here though.

    Thread Starter Sean Nicholson

    (@seanrnicholson)

    Any idea of an ETA on testing/resolving this? It’s holding us up from proceeding on a project. Let me know how we can help with testing.

    Thanks!

    Plugin Author bnfw

    (@voltronik)

    Hi @seanrnicholson,
    Still no ETA yet. Still working through a backlog of bugs but getting there. WIll update you if any progress.

    Plugin Author bnfw

    (@voltronik)

    Hi @seanrnicholson,
    After lots of testing, I haven’t been able to replicate this issue.
    I can only guess that it’s something to do with something external to BNFW – most likely a security plugin or feature on the server which is stripping the contents because it thinks the link is a security risk for some reason. At this point, there’s nothing left I can do to test or offer any other advice but if you’re able to check those parts of your server and set-up, that may highlight something.

    Thread Starter Sean Nicholson

    (@seanrnicholson)

    It’s the Avada theme on WP Engine, so a pretty common theme and hosting. I can replicate it every time. Our email logger says the email is sent, but it is never delivered. If I remove the “.pdf” then it works fine. My gut is the period in the .pdf is breaking your code. Are you sure you’re replicating it exactly?

    [global_site_url]/blog-post-pdfs/[post_slug] – adding the slug shortcode works.
    [global_site_url]/blog-post-pdfs/[post_slug].pdf – This does NOT work. When I add the “.pdf”

    Plugin Author bnfw

    (@voltronik)

    Hi @seanrnicholson,
    I have tried it every perceivable way to try and replicate it but I haven’t been able to. I’ve tested it the exact way you’ve specified.
    This has lead me to believe it must be something different between yours and my setups – something on a server that is changing things.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Adding shortcodes causes emails to not send’ is closed to new replies.