The unsubscribe URL from the [comment-subscribed:unsubscribe-url] token needs to be an absolute URL in the notification emails. Please review the attached patch.

Original report

My watcher email wasn't working properly in that the comment unsubscribe URL was just showing as an absolute path without a protocol or domain.

You can stop receiving emails when someone replies to this post, by going to
/comment_notify/disable/7AV75zg-8gb4PWFkzzlJVPeGonak_wCdSXk3E9tXUvo

I pasted all the tokens into the body field to test them and received this in the email:

Unsubscribe URL /comment_notify/disable/7AV75zg-8gb4PWFkzzlJVPeGonak_wCdSXk3E9tXUvo The URL to disable notifications for the comment.
Absolute URL [comment-subscribed:unsubscribe-url:absolute] The absolute URL.
Arguments [comment-subscribed:unsubscribe-url:args] The specific argument of the current page (e.g. 'arg:1' on the page 'node/1' returns '1').
Brief URL [comment-subscribed:unsubscribe-url:brief] The URL without the protocol and trailing backslash.
Path [comment-subscribed:unsubscribe-url:path] The path component of the URL.
Relative URL [comment-subscribed:unsubscribe-url:relative] The relative URL.
Unaliased URL [comment-subscribed:unsubscribe-url:unaliased] The unaliased URL.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TommyK created an issue. See original summary.

ShaunDychko’s picture

Title: [comment-subscribed:unsubscribe-url:*] tokens not working » Unsubscribe URL needs to be absolute
Issue summary: View changes
ShaunDychko’s picture

Status: Active » Needs review
FileSize
1.18 KB
ShaunDychko’s picture

Updated the code comment for the @return annotation.

ShaunDychko’s picture

Remove extraneous variable.

nkoporec’s picture

Status: Needs review » Reviewed & tested by the community

Hey @Shaun, tested your patch and it's working as expected.It removes the bug and set the absolute path.Good job!

  • greggles committed 6b7da6a on 8.x-1.x authored by ShaunDychko
    Issue #2911686 by ShaunDychko, nkoporec: Unsubscribe URL needs to be...
greggles’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the issue submission, patch, and review!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.