Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new functions composer.composeCase and composer.composeType #357

Open
RealRaven2000 opened this issue Feb 9, 2025 · 1 comment
Open
Assignees
Labels
enhancement sandbox script related to %{% user scripts! %}%

Comments

@RealRaven2000
Copy link
Owner

The new functions composer.composeCase and composer.composeType are designed to retrieve the particular compose type from composer:

composeType: [strings] build in compose type from nsIMsgCompType.
Possible return values:

"New"
"Reply"
"ReplyAll"
"ForwardAsAttachment"
"ForwardInline"
"NewsPost"
"ReplyToSender"
"ReplyToGroup"
"ReplyToSenderAndGroup"
"Draft"
"Template"
"MailToUrl"
"ReplyWithTemplate"
"ReplyToList"
"Redirect"
"EditAsNew"
"EditTemplate"

composeCase: [string] simplified compose case, used by SmartTemplates. This is broken down to 3 different states, depending on composeType. Depending on this the appropriate account templates are used. Possible values:

"new"    // write - generally used for new mails.
"rsp"      // reply / reply all / reply list etc.
"fwd"     // forward
@RealRaven2000 RealRaven2000 added enhancement sandbox script related to %{% user scripts! %}% labels Feb 9, 2025
@RealRaven2000 RealRaven2000 self-assigned this Feb 9, 2025
@RealRaven2000 RealRaven2000 changed the title new functions composer.composeCase and composer.composeType new functions composer.composeCase and composer.composeType Feb 9, 2025
@RealRaven2000
Copy link
Owner Author

In order to use these values in a sandbox script, you can use the following syntax:

<p>
 %{% 
  (async () => {
    let t = await composer_composeType();
    let c = await composer_composeCase();
    switch(t) {
      case "ForwardAsAttachment":
        return "Please find attached the files:"
      case "ReplyAll":
        return "To whom it may concern."
    }
})()
%}%
</p>

RealRaven2000 added a commit that referenced this issue Feb 9, 2025
added composer.composeCase and  composer.composeType for sandbox usage
catching sandbox errors caused by bad variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement sandbox script related to %{% user scripts! %}%
Projects
None yet
Development

No branches or pull requests

1 participant