Hi,

In function views_send_mail_action can the logic be changed so that tokens are processed before eventual php evaluation? I think this way is easier to access the necessary fields of the view.

Vitalie

Comments

hansfn’s picture

Status: Active » Postponed (maintainer needs more info)

What is the issue here? What doesn't work?

vitalie’s picture

I have these fields in the view: title, firstname, middle initials, lastname, sufix and some may be empty. I want to start my message as 'Dear title firstname middle initials lastname suffix', but I do not want to have two or more spaces (in case a field is empty).

I find that it would be easy for me to use some php to test if a field is empty or not, but at the same time to get the value of the field from the tokens. However, I think that the order of parsing is first evaluate php, then evaluate tokens and thus $test = '[views-send-field_firstname]' is always not empty. On the other had, if the token would be first evaluated and the value would be empty, then $test='' and when php is evaluated it would rightly see that it is empty.

I hope this is clearer.

hansfn’s picture

Assigned: Unassigned » hansfn
Status: Postponed (maintainer needs more info) » Active

Thx, that made it clearer. If I don't find any reason for the current order, I can definitely switch it. Your use case makes a lot of sense.

hansfn’s picture

Issue summary: View changes

Sorry, mistype.

vitalie’s picture

Hi, so what do you think about switching the order? Since then, I've had other uses cases. For example, I've been using views_send to send messages that contain a one-time-login link to certain users. It's very easy to do it with the order I suggest. This applies to Drupal 7 version as well.

hansfn’s picture

Version: 6.x-1.0-beta2 » 7.x-1.x-dev
Issue summary: View changes

Moved to D7. No more new features for the D6 version.

hansfn’s picture

Status: Active » Closed (won't fix)

Sorry, but I don't see that I will have time to fix any D7 issues.