Skip to content

Add parameters for converting to uppercase, lowercase or capitalising of text matching function #288

Closed

Description

@RealRaven2000

Text matching functions such as matchTextFromBody() will be even more useful if they allow conversion of case - these can be supplied with an additional parameter such as:

%matchTextFromBody("Customer.*\n\-+\n(.*)\n",1,capitalize)%
%matchTextFromSubject("Customer.*\n\-+\n(.*)\n",1,uppercase)%
%matchTextFromBody("Customer.*\n\-+\n(.*)\n",1,lowercase)%

%header.prefix.matchFromBody(subject,"Customer.*\n\-+\n(.*)\n",1,capitalize)%

Activity

  1. RealRaven2000 commented on Apr 28, 2024

    @RealRaven2000
    OwnerAuthor

    Here is a preview / tryout version:

    smartTemplate-fx-4.5pre35.zip

    The formatting parameters (capitalize, uppercase, lowercase, camelcase) can also be combined with the toclipboard parameter:

    %matchTextFromBody("Customer.*\n\-+\n(.*)\n",1,capitalize,toclipboard)%
    

    To install, download archive and drop into Thunderbird Add-ons Manager (don't extract contents).

  2. added 5 commits that reference this issue on Apr 28, 2024
  3. RealRaven2000 commented on May 1, 2024

    @RealRaven2000
    OwnerAuthor

    I decided to also add support applying these text transformation to the address variables, as in the following example:

    %recipient(firstname,uppercase,lastname,capitalize)%
    %from(name,lowercase)%
    

    The switch will format all previous components in the line (but not overwrite earlier transformations of a different switch), so e.g. in the example "1,uppercase,2,3,lowercase" 1 will be in uppercase, 2 and 3 will be in lowercase.

    smartTemplate-fx-4.5pre70.zip


    To install, download archive and drop into Thunderbird Add-ons Manager (don't extract contents).

  4. added a commit that references this issue on May 1, 2024
  5. RealRaven2000 commented on May 14, 2024

    @RealRaven2000
    OwnerAuthor

    Implemented in 4.5 released on 14/05/2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions