Skip to main content
Provided Links
Source Link
Mołot
  • 21.9k
  • 8
  • 59
  • 112

The best solution (IMHO) doesn't actually work: you should be able to use the Tokens module and use a proper token to fill a recipient field. For example: [node:author:mail]

However, Webforms only appears to support its own %something ` tokens, and those only relate to the current user and the webform id (not the id of the node being read).

So instead, write the site's inevitable custom module and use hook_mail_alter() to change the To address.

Another resource I read (and have now lost) suggested setting the Webforms recipient to something easily recognizable, like "[email protected]".

Then in your hook_mail_alter() function,

  1. confirm the form's identity,
  2. get the current post's author,
  3. get that user's email address, and
  4. use it in the Recipients. (Along with the admin & the poster, as you like.)

The best solution (IMHO) doesn't actually work: you should be able to use the Tokens module and use a proper token to fill a recipient field. For example: [node:author:mail]

However, Webforms only appears to support its own %something ` tokens, and those only relate to the current user and the webform id (not the id of the node being read).

So instead, write the site's inevitable custom module and use hook_mail_alter() to change the To address.

Another resource I read (and have now lost) suggested setting the Webforms recipient to something easily recognizable, like "[email protected]".

Then in your hook_mail_alter() function,

  1. confirm the form's identity,
  2. get the current post's author,
  3. get that user's email address, and
  4. use it in the Recipients. (Along with the admin & the poster, as you like.)

The best solution (IMHO) doesn't actually work: you should be able to use the Tokens module and use a proper token to fill a recipient field. For example: [node:author:mail]

However, Webforms only appears to support its own %something tokens, and those only relate to the current user and the webform id (not the id of the node being read).

So instead, write the site's inevitable custom module and use hook_mail_alter() to change the To address.

Another resource I read (and have now lost) suggested setting the Webforms recipient to something easily recognizable, like "[email protected]".

Then in your hook_mail_alter() function,

  1. confirm the form's identity,
  2. get the current post's author,
  3. get that user's email address, and
  4. use it in the Recipients. (Along with the admin & the poster, as you like.)

The best solution (IMHO) doesn't actually work: you should be able to use the TokensTokens module and use a proper token to fill a recipient field. For example: [node:author:mail]

However, Webforms only appears to support its own %something%something ` tokens, and those only relate to the current user and the webform id (not the id of the node being read).

So instead, write the site's inevitable custom module and use hook_mail_alter() to change the To address.

Another resource I read (and have now lost) suggested setting the Webforms recipient to something easily recognizable, like "[email protected]".

Then in your hook_mail_alter() function,

  1. confirm the form's identity,
  2. get the current post's author,
  3. get that user's email address, and
  4. use it in the Recipients. (Along with the admin & the poster, as you like.)

The best solution (IMHO) doesn't actually work: you should be able to use the Tokens module and use a proper token to fill a recipient field. For example: [node:author:mail]

However, Webforms only appears to support its own %something tokens, and those only relate to the current user and the webform id (not the id of the node being read).

So instead, write the site's inevitable custom module and use hook_mail_alter() to change the To address.

Another resource I read (and have now lost) suggested setting the Webforms recipient to something easily recognizable, like "[email protected]".

Then in your hook_mail_alter function,

  1. confirm the form's identity,
  2. get the current post's author,
  3. get that user's email address, and
  4. use it in the Recipients. (Along with the admin & the poster, as you like.)

The best solution (IMHO) doesn't actually work: you should be able to use the Tokens module and use a proper token to fill a recipient field. For example: [node:author:mail]

However, Webforms only appears to support its own %something ` tokens, and those only relate to the current user and the webform id (not the id of the node being read).

So instead, write the site's inevitable custom module and use hook_mail_alter() to change the To address.

Another resource I read (and have now lost) suggested setting the Webforms recipient to something easily recognizable, like "[email protected]".

Then in your hook_mail_alter() function,

  1. confirm the form's identity,
  2. get the current post's author,
  3. get that user's email address, and
  4. use it in the Recipients. (Along with the admin & the poster, as you like.)
Source Link

The best solution (IMHO) doesn't actually work: you should be able to use the Tokens module and use a proper token to fill a recipient field. For example: [node:author:mail]

However, Webforms only appears to support its own %something tokens, and those only relate to the current user and the webform id (not the id of the node being read).

So instead, write the site's inevitable custom module and use hook_mail_alter() to change the To address.

Another resource I read (and have now lost) suggested setting the Webforms recipient to something easily recognizable, like "[email protected]".

Then in your hook_mail_alter function,

  1. confirm the form's identity,
  2. get the current post's author,
  3. get that user's email address, and
  4. use it in the Recipients. (Along with the admin & the poster, as you like.)