https://redmine.gc.cuny.edu/https://redmine.gc.cuny.edu/favicon.ico2018-08-28T18:53:07ZCUNY Graduate Center - Project Tracking SystemCUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=386152018-08-28T18:53:07ZMatt Goldmattgold@gmail.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>Boone Gorges</i></li></ul><p>okay -- I made the to her account for her. Leaving assigned to Boone to troubleshoot the missing link</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=386702018-08-29T19:56:15ZBoone Gorgesboone@gorg.es
<ul><li><strong>File</strong> <a href="/attachments/8681">Screenshot_2018-08-29_19-55-04.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/8681/Screenshot_2018-08-29_19-55-04.png">Screenshot_2018-08-29_19-55-04.png</a> added</li><li><strong>Assignee</strong> changed from <i>Boone Gorges</i> to <i>Raymond Hoh</i></li><li><strong>Priority name</strong> changed from <i>Normal</i> to <i>High</i></li><li><strong>Target version</strong> set to <i>1.13.8</i></li></ul><p>I began debugging this and it turns out that an RBE 'bp_email_get_property' callback is doing some odd filtering. Specifically, the strpos logic here <a class="external" href="https://github.com/r-a-y/bp-reply-by-email/blob/b09c020d5a6e635d42c18eb035065d3f03c046b0/bp-rbe-core.php#L885">https://github.com/r-a-y/bp-reply-by-email/blob/b09c020d5a6e635d42c18eb035065d3f03c046b0/bp-rbe-core.php#L885</a> doesn't appear to be correct. I'm unsure whether this is specific to the password reset email.</p>
<p>Ray, could you please have a look?</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=386762018-08-29T20:22:32ZRaymond Hoh
<ul></ul><p>Eek, thanks for finding this bug.</p>
<p>I'm about to push a commit for this.</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=386772018-08-29T20:24:34ZBoone Gorgesboone@gorg.es
<ul><li><strong>Subject</strong> changed from <i>email change problem</i> to <i>Placeholders in action emails (activation, password reset) not being properly swapped</i></li><li><strong>Priority name</strong> changed from <i>High</i> to <i>Urgent</i></li></ul><p>Ray, if you're looking into this, could you please update the ticket? I'm going to start working on it myself, but I don't want to duplicate effort.</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=386782018-08-29T20:25:41ZBoone Gorgesboone@gorg.es
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-6 priority-4 priority-default closed" href="/issues/10260">Bug #10260</a>: bad activation email</i> added</li></ul> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=386812018-08-29T20:26:15ZBoone Gorgesboone@gorg.es
<ul></ul><p>Oops, cross-post. Thanks Ray!</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=386832018-08-29T20:29:26ZRaymond Hoh
<ul></ul><p>I've added a fix to skip the non-RBE notice injection into registration with blog and email change emails - <a class="external" href="https://github.com/cuny-academic-commons/cac/commit/c98b1886a825db221e011729b913e2c8a37503d3">https://github.com/cuny-academic-commons/cac/commit/c98b1886a825db221e011729b913e2c8a37503d3</a></p>
<p>I've tested by changing my email address on the "Settings > General" page and the email content now successfully renders.</p>
<p><a class="issue tracker-1 status-6 priority-4 priority-default closed" title="Bug: bad activation email (Rejected)" href="https://redmine.gc.cuny.edu/issues/10260">#10260</a> appears to be a different bug. I'm looking into this.</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=386952018-08-29T21:03:18ZBoone Gorgesboone@gorg.es
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Staged for Production Release</i></li></ul><p>Thanks - I'll mark this as Staged and test after release.</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=387192018-08-29T21:38:48ZBoone Gorgesboone@gorg.es
<ul><li><strong>Status</strong> changed from <i>Staged for Production Release</i> to <i>Resolved</i></li></ul><p>Working now. Thanks for your quick attention to this.</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=387682018-08-30T18:39:49ZRaymond Hoh
<ul><li><strong>Category name</strong> set to <i>Email Notifications</i></li></ul><p>I wanted to spend a bit more time on this issue as the RBE workaround seemed to be unnecessary in my eyes.</p>
<p>I found the real cause of the issue. The problem is BuddyPress changed a bit of the email HTML template markup in BuddyPress 3.0, which broke how I was stripping the "Hi USER" salutation from HTML emails.</p>
<p>This caused invalid, broken HTML markup and was the actual reason for the truncated email content in the email address verification email.</p>
<p>I've fixed this here - <a class="external" href="https://github.com/cuny-academic-commons/cac/commit/5019aa2c74e2d715013ea87dbb7b927e9171f7aa">https://github.com/cuny-academic-commons/cac/commit/5019aa2c74e2d715013ea87dbb7b927e9171f7aa</a></p>
<p>This also fixes how the user hyperlink was no longer showing up in group emails.</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=387692018-08-30T18:41:53ZBoone Gorgesboone@gorg.es
<ul></ul><p>Thanks, Ray. This is the second or third time I've come across a similar issue in RBE since some changes in BP 3.0. Just spitballing, but do you think there's something that BP could do with its default templates to make this kind of strpos juggling unnecessary? Like what if the template included HTML comments that served as landmarks (sorta like WP actions) - something like <!-- bp.start_of_message --> - so that you could use this when moving your markers around?</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=387712018-08-30T18:48:31ZRaymond Hoh
<ul></ul><p>It's not a RBE problem. The stripping of the "Hi USER" salutation from BP HTML emails is a CAC customization.</p>
<p>One of my other thoughts was to override the BP email HTML template to remove the salutation. However, the salutation is used in GES digests and you can't use conditionals in the email template. <strong>Update</strong> - Actually, I think BP has an email template hierarchy, so this could be potentially done.</p>
<p>Although the usage of HTML comments to denote certain sections in the BP HTML email template sounds like a good idea in general.</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=387742018-08-30T18:58:37ZBoone Gorgesboone@gorg.es
<ul></ul><blockquote>
<p>It's not a RBE problem. The stripping of the "Hi USER" salutation from BP HTML emails is a CAC customization.</p>
</blockquote>
<p>I'm referring to the fact that RBE has to use string manipulation to figure out where to put its marker. It's not so much that it's an RBE "problem", it's that RBE has come up with the only possible workaround to the fact that email templates are unstructured entities.</p>
<p>A custom email template in our theme seems like it may be a good idea.</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=387822018-08-30T19:24:46ZRaymond Hoh
<ul></ul><p>Yes, RBE has to rely on HTML source manipulation to re-position the marker, but that isn't the cause of this Redmine issue.</p>
<p>The cause of this issue is due to the changes to the BP HTML email template and the stripping of the "Hi USER" salutation, which also happens to use string manipulation. I was previously attempting to strip a trailing <code><br></code> after the <code><hr /></code>, but that doesn't seem to be necessary any more in the latest BP HTML email template.</p>
<p>RBE doesn't strip the "Hi User" salutation, CAC does. I don't think it's necessary to override the BP HTML email template at this time as there shouldn't be any more problems going forward, unless there are more changes done to the salutation markup in the future.</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=387832018-08-30T19:29:37ZBoone Gorgesboone@gorg.es
<ul></ul><p>I see. Sort of :)</p>
<p>I had one or two client sites experience some ugly issues after upgrading to BP 3.0 because of the RBE parsing, so I guess I was thinking that maybe there was the possibility of a longer-term fix. But I have put much less thought into this than you have, so I'm happy to go with whatever solution you think best!</p> CUNY Academic Commons - Support #10245: Placeholders in action emails (activation, password reset) not being properly swappedhttps://redmine.gc.cuny.edu/issues/10245?journal_id=387872018-08-30T20:02:15ZRaymond Hoh
<ul></ul><p>After looking at this a little closely, I do see now that RBE is aggressively removing the marker plus the trailing <code><br /></code> and whitespace after the salutation!</p>
<p>So RBE is somewhat at fault here. Although, this problem would only occur if your client sites have customized the main body of the BP HTML email template.</p>
<p>I'll create an issue over at the RBE repo to track this.</p>