As a side effect of the workaround in #2122909: Unwanted conversion of quotes in fields used for recipient's e-mail and name, which was to bypass the views render layer, I'm having trouble using an email address not provided by a simple node content view. In particular, I'm using a webform submissions type view, as provided by webform 7.x-4.0, but _views_send_get_raw_field_from_views_row() is returning the submission ID instead of the actual email address entered into the webform, which is an integer and not a valid email address. My client's use case is wanting to use views_send to generate email receipts to users who have registered for a conference using the webform module, but I can imagine using a search API views backend to select users, and other use cases as well.

I believe the above workaround is going to cause a large number of other, similar problems, unless views_send incorporates workarounds for every type of field for every type of views backend, such as was done in #2362741: Custom text field don't work.

Unwanted escaping of an (unusual) email address such as fred.o'leary@example.com may in fact be a views bug, but working around that by breaking everything other than content views is probably going to cause more serious problems.

I would suggest resolving this by reverting commit f586e23.

Comments

hansfn’s picture

OK, I see the problem, and you are probably right that I have created a problem with the solution. Annoying.

The solution wasn't really about just fixing the quote issue. It just felt very wrong to fetch the rendered field (with HTML code and all) and the stripping it down to the text (raw) value of the field. Is there some Views function I have overlooked ...

hansfn’s picture

Title: Bypassing views render layer breaks other views backends » Bypassing views render layer breaks all sort of things
Status: Active » Fixed

OK, I have finally reverted[1] this change so for example rewritten fields work in the recipient name or mail address. I'll make a new release when it's confirmed that this works as wanted.

PS! The "Custom text field don't work." issue was actually something different.

[1] The commit f586e23 isn't actually reverted, but the unwanted effect is.

  • hansfn committed 5b5b1f6 on 7.x-1.x
    Issue #2368533: Bypassing views render layer breaks all sort of things
    
liquidcms’s picture

I have tested that rewritten email fields may be used as the email address. I also verified these rewritten fields may be used in the body of the email (as tokens).

thanks for fixing this.

hansfn’s picture

Status: Active » Closed (fixed)

Thx for verifying. Will create a new release today.