mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
The send-email action gets a member picker under To: typing filters the board's active members by user name or full name, and a pick adds @username to To. Addresses are still typed into To as before. When the rule runs, each @username becomes that member's current email address, so the rule - and whoever edits it - holds a user name, never somebody's address, and a member who changes address is still reached. A @name of somebody who is not an active member of the board, or has no address, is dropped rather than sent as text, and nobody is mailed twice. models/lib/ruleEmailMembers.js holds the parsing, the choices and the expansion; tests/ruleEmailMembers.test.cjs covers them, non-members, duplicates, an address with @ inside, and that the picker never reads an email address. rulesHelper imports it, so the ruleEmailFailure harness, which runs rulesHelper without require, is given it as it is given ruleParts. The new strings are English placeholders until the next translation pass. Thanks to chenghongxi and xet7 ! Fixes #2435.
35 lines
1.6 KiB
Plaintext
35 lines
1.6 KiB
Plaintext
template(name="mailActions")
|
|
div.trigger-item.trigger-item-mail(data-editor-scope)
|
|
div.trigger-content.trigger-content-mail
|
|
div.trigger-text.trigger-text-email
|
|
| {{_'r-send-email'}}
|
|
div.trigger-dropdown-mail
|
|
input(id="email-to",type=text,placeholder="{{_'r-to'}}")
|
|
//- #2435: pick board members with autocomplete; each is added to To as
|
|
@username and reaches that member's own address when the rule runs.
|
|
Free addresses are typed into To as before.
|
|
div.trigger-dropdown-mail
|
|
input.js-email-to-member(type="text" list="email-to-members" placeholder="{{_ 'r-email-add-member'}}" aria-label="{{_ 'r-email-add-member'}}" autocomplete="off")
|
|
datalist#email-to-members
|
|
each memberChoices
|
|
option(value=value)= label
|
|
input(id="email-subject",type=text,placeholder="{{_'r-subject'}}")
|
|
textarea(id="email-msg" data-editor-submit=".js-mail-action")
|
|
label
|
|
input#email-card-details(type="checkbox")
|
|
| {{_ 'details'}}
|
|
label
|
|
input#email-discussion(type="checkbox")
|
|
| {{_ 'checklists'}} / {{_ 'comments'}}
|
|
label
|
|
input#email-attachments(type="checkbox")
|
|
| {{_ 'attachments'}}
|
|
div.trigger-hint.trigger-hint-email-vars
|
|
| {{_'r-email-vars-hint'}}
|
|
div.trigger-hint.trigger-hint-people-vars
|
|
| {{_'r-vars-people-hint'}}
|
|
div.trigger-hint.trigger-hint-email-members
|
|
| {{_'r-email-members-hint'}}
|
|
button.trigger-button.trigger-button-email.js-mail-action.js-goto-rules(type="button" aria-label="{{_ 'r-add-action'}}")
|
|
i.fa.fa-plus(aria-hidden="true")
|