Skip to content
LH edited this page Dec 28, 2024 · 50 revisions

Get Started with AzMailer

Requirements

Installation Steps

The Azmaier is portable and doesn’t need to be installed. You can simply copy the root folder to the desired directory and Extract it there

  1. Install the .NET Runtime and WebView Runtime.
  2. Extract the downloaded AzMailer zip file.
  3. Create a shortcut to azmailer.exe on your desktop.
  4. On the first launch, the software will automatically create a database and default settings at %userprofile%\AppData\Local\azmailer\DB.
  5. A workflow pool folder will be created at %userprofile%\AppData\Local\azmailer\pool\AzMailer.
  6. A PDF printer named "AzMailer" will be set up, and the output will be saved to %userprofile%\AppData\Local\azmailer\pool\AzMailer.

Multi-User Setup

To allow multiple users to work with the same database across different computers:

  1. Move the database to a shared folder.
  2. Edit the path.json file located in the installation directory at AzMailer\Environment\path.json.
  3. Update the path in the JSON file to the new shared database location.

Workflow

Workflows automate the sequence of actions when files are moved to the pool.

Workflow Parameters

  • Active: Check this box to enable the workflow. If unchecked, the workflow will be inactive.
  • Profile: Assign a unique name to the workflow.
  • Target: Assign profiles to specific users when multiple people share the database, or set the profile to 'default'. Only one profile can be set as the default.
  • SearchPattern: Define the file types to process (e.g., *.* for all files, *.pdf for PDFs only, any?name.csv for specific filenames).
  • Flow: Define the actions, order, and number.
  • User: Required if the pool folder is access-protected.
  • Pass: Required if the pool folder is access-protected.
  • Pool: is the location where AzMailer looks for files to process.
  • Trigger: [Interval, Repeat, At]
    • Interval: Frequency of workflow execution.
    • Repeat: Number of executions before the workflow is deactivated (0 for infinite).
    • At: Start time of the interval (yyyy-MM-dd HH:mm:ss), e.g., yyyy-MM-dd 10:00:00
  • Note: Add a description (optional, no functional impact).

How it works:

A loop goes through all active workflows, e.g., the workflow Profile named "workflow01". When a file such as "attachment.pdf" is moved into the pool for "workflow01", the system first checks if the flow for "workflow01" is not empty. It then scans the contents of "attachment.pdf" to check if an embedded flow is found. If a flow is found in "attachment.pdf", it overrides the existing "workflow01" flow. Otherwise, the current "workflow01" flow remains unchanged.

**AzMailer can scan the contents of .PDF and .TXT files for flows **

Examples:

Create a default flow in AzMailer that renames a file, copies it to a shared folder, and prints it using the default printer profile

[
  {"Name": {"NewName":"%HH% %mm% - %filename%"}},
  {"Copy": {"Profile":"MyC1"}},
  {"Print": {}},
]

Send a custom flow from the script (e.g., embed the flow in a PDF) that renames a file, copies it to a shared folder, and prints it using the default printer profile

**[
  {"Name": {"NewName":"%HH% %mm% - %filename%"}},
  {"Copy": {"Profile":"MyC1"}},
  {"Print": {}},
]**

Actions

"Actions in AzMailer define specific tasks that the software automates as part of a workflow. These actions are executed sequentially, from top to bottom, in the order they appear.

When a workflow is run and an action like "Name" is encountered (e.g., [{"Name":{}}]), the system first checks if a specific profile is provided for the action (e.g., [{"Name":{"Profile":"P1"}}]). If a profile is specified, such as "P1", the system looks for this profile in the NameProfiles database. If no specific profile is provided (e.g., [{"Name":{}}]), the system searches the NameProfiles database for a profile assigned to the currently logged-in user. If a profile is found, it is loaded; otherwise, the default profile for the "Name" action is used.

Finally, all parameters of the "Name" action are overwritten with the values from the selected profile, except for those parameters that are explicitly provided in the workflow. For example, in the case of [{"Name":{"NewName":"%filename%"}}], only the NewName parameter is passed, so all other parameters will be loaded from the profile, while the NewName value will take precedence and ignore the profile’s data for that specific parameter."

- Trigger

Rules for countdown timer to start the next action.

Parameters:

{"Trigger":{"Active":"","Profile":"","Target":"","Preview":"","Timer":"","Note":""}}

Parameter Details:

  • Active: Action status (0 for inactive, 1 for active).
  • Profile: Assign unique name for the Action.
  • Target: Assign profiles to specific users when multiple people share the database, or set the profile to 'default'. Only one profile can be set as the default.
  • Preview: Set '0' to process data in the background with no window displayed. Set '1' if user interaction is required, a window will open.
  • Timer: Set the countdown timer to start the next action: yyyy-MM-dd HH:mm:ss
    • yyyy: Year
    • MM: Month
    • dd: Day
    • HH: Hour
    • mm: Minute
    • ss: Second
  • Note: Optional description with no functional impact.

Example:

starts at 8:00 p.m.:

[
  {"Trigger": {"Timer":"yyyy-MM-dd 20:mm:ss"}}
]

- Name

Automate Rename files based on predefined rules using either fixed names or variables.

Parameters:

{"Name":{"Active":"","Profile":"","Target":"","Preview":"","Source":"","NewName":"","Note":""}}

Parameter Details:

  • Active: Action status (0 for inactive, 1 for active).
  • Profile: Assign unique name for the Action.
  • Target: Assign profiles to specific users when multiple people share the database, or set the profile to 'default'. Only one profile can be set as the default.
  • Preview: Set '0' to process data in the background with no window displayed. Set '1' if user interaction is required, a window will open.
  • Source: Full path of the file to be processed.
  • NewName: Enter the new name. Available variables:
    • %yyyy%: Year
    • %MM%: Month
    • %dd%: Day
    • %HH%: Hour
    • %mm%: Minute
    • %ss%: Second
    • %fff%: Millisecond
    • %filename%: Original filename
    • %extension%: File extension
    • %filenamewithoutextension%: Filename without extension
  • Note: Optional description with no functional impact.

Example:

Rename file using time and filename:

[
  {"Name": {"NewName":"%HH%  %mm% - %filename%"}}
]

- Merge

Automate merging PDFs, inserting images, adding text to PDFs, creating and inserting barcodes, creating and inserting QR codes

Parameters:

{"Merge":{"Active":"","Profile":"","Target":"","Preview":"","Source":"","Stamp":"","Type":"","Pages":"","PositionXY":"","ScaleXY":"","Font":"","Note":""}}

Parameter Details:

  • Active: Action status (0 for inactive, 1 for active).
  • Profile: Assign unique name for the Action.
  • Target: Assign profiles to specific users when multiple people share the database, or set the profile to 'default'. Only one profile can be set as the default.
  • Preview: Set '0' to process data in the background with no window displayed. Set '1' if user interaction is required, a window will open.
  • Source: Full path of the file or text to be processed.
  • Type: Select the type of stamp to insert into the PDF file:
    • 0: PDF – Merge PDF files
    • 1: Image – Insert an image
    • 2: Text – Add text
    • 3: Barcode – Create and insert a barcode
    • 4: QR Code – Create and insert a QR Code
  • Stamp: Apply a PDF, image, or text as a stamp.
  • Pages: Define which pages to apply changes (e.g., all ~, or specific pages 2,4).
  • PositionXY: X and Y coordinates for placing the stamp.
  • ScaleXY: Scale of the object (width and height).
  • Font: Set font color and size (e.g., 252, 0, 0, 12 for red color with font size 12).
  • Note: Optional description with no functional impact.

Example:

Add PNG signature to a PDF:

[
  {"Merge": {"Stamp":"D:\\folder\\signature.png", "PositionXY":"50,50"}}
]

- XInvoice

Create and validate XInvoices (XRechnung, ZUGFeRD, Factur-X) according to current standards.

Parameters:

{"XInvoice":{"Active":"","Profile":"","Target":"","Preview":"","Source":"","Validation":"","Format":"","Invoice":{"BT1":"","BT2":"","BT3":"","BT5":"","BT6":"","BT7":"","BT8":"","BT9":"","BT10":"","BT11":"","BT12":"","BT13":"","BT14":"","BT15":"","BT16":"","BT17":"","BT18":"","BT19":"","BT20":"","BG1":[{"BT21":"","BT22":""},{"BT21":"","BT22":""}],"BG2":{"BT23":"","BT24":""},"BG3":[{"BT25":"","BT26":""}],"BG4":{"BT27":"","BT28":"","BT29":[],"BT30":"","BT31":"","BT32":"","BT33":"","BT34":"","BG5":{"BT35":"","BT36":"","BT162":"","BT37":"","BT38":"","BT39":"","BT40":""},"BG6":{"BT41":"","BT42":"","BT43":""}},"BG7":{"BT44":"","BT45":"","BT46":"","BT47":"","BT48":"","BT49":"","BG8":{"BT50":"","BT51":"","BT163":"","BT52":"","BT53":"","BT54":"","BT55":""},"BG9":{"BT56":"","BT57":"","BT58":""}},"BG10":{"BT59":"","BT60":"","BT61":""},"BG11":{"BT62":"","BT63":"","BG12":{"BT64":"","BT65":"","BT164":"","BT66":"","BT67":"","BT68":"","BT69":""}},"BG13":{"BT70":"","BT71":"","BT72":"","BG14":{"BT73":"","BT74":""},"BG15":{"BT75":"","BT76":"","BT165":"","BT77":"","BT78":"","BT79":"","BT80":""}},"BG16":{"BT81":"","BT82":"","BT83":"","BG17":[{"BT84":"","BT85":"","BT86":""}],"BG18":{"BT87":"","BT88":""},"BG19":{"BT89":"","BT90":"","BT91":""}},"BG20":[{"BT92":"","BT93":"","BT94":"","BT95":"","BT96":"","BT97":"","BT98":""}],"BG21":[{"BT99":"","BT100":"","BT101":"","BT102":"","BT103":"","BT104":"","BT105":""}],"BG22":{"BT106":"","BT107":"","BT108":"","BT109":"","BT110":"","BT111":"","BT112":"","BT113":"","BT114":"","BT115":""},"BG23":[{"BT116":"","BT117":"","BT118":"","BT119":"","BT120":"","BT121":""}],"BG24":[{"BT122":"","BT123":"","BT124":"","BT125":""}],"BG25":[{"BT126":"","BT127":"","BT128":"","BT129":"","BT130":"","BT131":"","BT132":"","BT133":"","BG26":{"BT134":"","BT135":""},"BG27":[{"BT136":"","BT137":"","BT138":"","BT139":"","BT140":""}],"BG28":[{"BT141":"","BT142":"","BT143":"","BT144":"","BT145":""}],"BG29":{"BT146":"","BT147":"","BT148":"","BT149":"","BT150":""},"BG30":{"BT151":"","BT152":""},"BG31":{"BT153":"","BT154":"","BT155":"","BT156":"","BT157":"","BT158":[],"BT159":"","BG32":[{"BT160":"","BT161":""},{"BT160":"","BT161":""}]}}]},"Note":"","LastModifiedUser":"","LastModifiedTime":"","CreationUser":"","CreationTime":""}}

Parameter Details:

  • Active: Action status (0 for inactive, 1 for active).
  • Profile: Assign unique name for the Action.
  • Target: Assign profiles to specific users when multiple people share the database, or set the profile to 'default'. Only one profile can be set as the default.
  • Preview: Set '0' to process data in the background with no window displayed. Set '1' if user interaction is required, a window will open.
  • Source: Full path of the file to be processed.
  • Validation: Validation conditions:
    • 0: Create XML then Process only if no errors or warnings.
    • 1: Create XML then Process if no errors (warnings allowed).
    • 2: Create XML then process without validation (Always).
  • Format: Invoice format:
    • 0: Create CEFACT CII XML file.
    • 1: ZuGFeRD - Create Embedded XML in Source PDF: In this option, an CEFACT CII XML file is first created, then the source PDF will be converted to PDF/A-3, and the XML file will be embedded in the PDF. This functionality is only available for script-based generation. Note: PDF/A-3 is designed for long-term archiving, meaning the document cannot be modified after creation.
  • Invoice: Customize the contents of the X-Rechnung. All available specifications can be found in the parameters for each individual X-Rechnung/Receipt specification. The meaning of the parameters is available in the AzMailer software, where you can navigate to the XBuy Action window. Each field is identified by a specific ID labeled "BT."
  • Note: Optional description with no functional impact.

Example:

Script to create an invoice XRechnung:

[
   {"XInvoice": {"Preview": "0","Validation": "0","Format": "0",
         "Invoice": {"BT1": "00001","BT2": "20240925","BT3": "380","BT5": "EUR","BT9": "20240926","BT10": "04011000-1234512345",
            "BG4": {"BT27": "TestSeller GmbH","BT30": "HRB 987654 B","BT31": "DE123456789","BT34": "contact@testseller.de",
               "BG5": {"BT35": "Musterstraße 1","BT37": "Berlin","BT38": "10115","BT40": "DE"},
               "BG6": {"BT41": "Max Mustermann","BT42": "+493012345679","BT43": "max.mustermann@testseller.de"}},
            "BG7": {"BT44": "TestBuyer AG","BT49": "info@testbuyer.de",
               "BG8": {"BT50": "Beispielweg 10","BT52": "Munich","BT53": "80331","BT55": "DE"}},
            "BG13": {
              "BG15": {"BT75": "Beispielweg 10","BT77": "Munich","BT78": "80331","BT80": "DE"}},
            "BG16": {"BT81": "58",
               "BG17": [{"BT84": "DE75512108001245126199","BT85": "TestBuyer AG","BT86": "BicXXX"}]},
            "BG23": [{"BT118": "S","BT119": "19","BT120": ""}],
            "BG25": [{"BT126": "1","BT129": "1","BT130": "XPP",
            "BG29": {"BT148": "100,00"},
                  "BG30": {"BT151": "S","BT152": "19"},
                  "BG31": {"BT153": "Monitor","BT154": "Dell Monitor 27 Zoll"}}]}}}
]

- SMB

Automate file copying or moving to local or network directories.

Parameters:

{"SMB":{"Active":"","Profile":"","Target":"","Preview":"","Source":"","User":"","Pass":"","Overwrite":"","Destination":"","Task":"","Note":""}}

Parameter Details:

  • Active: Action status (0 for inactive, 1 for active).
  • Profile: Assign unique name for the Action.
  • Target: Assign profiles to specific users when multiple people share the database, or set the profile to 'default'. Only one profile can be set as the default.
  • Preview: Set '0' to process data in the background with no window displayed. Set '1' if user interaction is required, a window will open.
  • Source: Full path of the file to be copied.
  • User: Required if the file is protected.
  • Pass: Required if the file is protected.
  • Overwrite: Overwrite files in the target folder (0: No, 1: Yes).
  • Destination: Target folder path.
    • %yyyy%: Year
    • %MM%: Month
    • %dd%: Day
    • %HH%: Hour
    • %mm%: Minute
    • %ss%: Second
    • %fff%: Millisecond
    • %EnvironmentVariables%: Windows Environment Variables e.g. %USERPROFILE%
    • %base%: AzMailer base Folder path
    • %\%: Directory separator
  • Task: Copy or move files within the Windows environment or across a network.
    • 0: Copy
    • 1: Move
  • Note: Optional description with no functional impact.

Example:

Copy file to "C:\Users<CurrentUsername>\Documents\Archive<Year><Month>":

[
  {"SMB": {"Task":"0", "Preview":"0", "Destination":"%USERPROFILE% \\ Documents \\ Archive \\ %yyyy% \\ %MM%"}}
]

- Mail

Send files via SMTP with HTML Body and customizable limits.

Parameters:

{"Mail":{"Active":"","Profile":"","Target":"","Preview":"","Source":"","SendLimitD":"","SendLimitH":"","SendLimitM":"","SendMethod":"","List":"","FromMail":"","FromName":"","ToMail":"","CcMail":"","BccMail":"","Signature":"","Subject":"","Attachment":"","SMTPServer":"","SMTPPort":"","SMTPUser":"","SMTPPassword":"","SaveInSent":"","IMAPServer":"","IMAPPort":"","IMAPUser":"","IMAPPassword":"","Note":""}}

Parameter Details:

  • Active: Action status (0 for inactive, 1 for active).
  • Profile: Assign unique name for the Action.
  • Target: Assign profiles to specific users when multiple people share the database, or set the profile to 'default'. Only one profile can be set as the default.
  • Preview: Set '0' to process data in the background with no window displayed. Set '1' if user interaction is required, a window will open.
  • Source: Full path of the file to be sent.
  • SendLimitD: Max emails per day. If the limit is reached, sending will resume at 00:00:00
  • SendLimitH: Max emails per hour. If the limit is reached, sending will resume at xx:00:00
  • SendLimitM: Max emails per minute. If the limit is reached, sending will resume at xx:xx:00
  • SendMethod: Choose how to send the email.
    • 0: mass - send to all recipients at the same time (mass = To.count + Cc.count + Bcc.count)
    • 1: single - individually send (single = 1x per email only To)
    • 2: single from csv - individually send (single = 1x per email only To) read the list of emails from CSV file
  • List: the CSV file if the SendMethod ist 2selected
  • FromMail: Sender email.
  • FromName: Sender name.
  • ToMail: Recipient email.
  • CcMail: Carbon copy recipient.
  • BccMail: Blind carbon copy recipient.
  • Signature: Email signature.
  • Subject: Email subject.
  • Attachment: Attach file to the email.
  • SMTPServer: SMTP server address.
  • SMTPPort: SMTP port.
  • SMTPUser: SMTP user credentials.
  • SMTPPassword: SMTP password.
  • SaveInSent: Save in sent folder (0: No, 1: Yes).
  • IMAPServer: IMAP server for saving sent emails.
  • IMAPPort: IMAP port.
  • IMAPUser: IMAP user credentials.
  • IMAPPassword: IMAP password.
  • Note: Optional description with no functional impact.
  • Variables: Dynamic replacement of specific Email Body-Text and subject-Text. available for scripts only

Example:

Send email: (If the email is sent via script, the script file will be sent as an attachment)

[
  {"Mail": {"ToMail":"recipient@domain.com", "Subject":"Invoice"}}
]

Send email with no attachments:

[
  {"Mail": {"ToMail":"recipient@domain.com", "Subject":"Invoice", "Attachment":"no"}}
]

Send email with additional attachments:

[
  {"Mail": {"ToMail":"recipient@domain.com", "Subject":"Invoice", "Attachment":"this,C:\\files\\AGB.pdf"}}
]

- Print

Automate PDF printing.

Parameters:

{"Print":{"Active":"","Profile":"","Target":"","Preview":"","Source":"","Printer":"","Copies":"","Duplex":"","FromPage":"","ToPage":"","Color":"","Landscape":"","PaperSize":"","PaperSource":"","Resolution":"","Note":""}}

Parameter Details:

  • Active: Action status (0 for inactive, 1 for active).
  • Profile: Assign unique name for the Action.
  • Target: Assign profiles to specific users when multiple people share the database, or set the profile to 'default'. Only one profile can be set as the default.
  • Preview: Set '0' to process data in the background with no window displayed. Set '1' if user interaction is required, a window will open.
  • Source: Full path of the file to be printed.
  • Printer: The name of the printer to be used for printing the document.
  • Copies: The number of copies of the document to print.
  • Duplex: Whether the document is printed on both sides of the paper (double-sided printing).
  • FromPage: The first page of the document to print.
  • ToPage: The last page of the document to print.
  • Color: Whether the document is printed in color or in black-and-white.
  • Landscape: The orientation of the page.
  • PaperSize: The size of the paper being used for printing (e.g., A4, Letter).
  • PaperSource: The tray or source where the printer is pulling paper from.
  • Resolution: The print quality, usually measured in dots per inch (DPI).
  • Note: Optional description with no functional impact.

Example:

Print document:

[
  {"Print": {"Printer": "HP OfficeJet Pro", "FromPage":"1","ToPage":"3", "Duplex": "0"}}
]

- FTP

Automate the upload and download of files to an FTP server using FTP or FTPS protocols.

Parameters:

{"FTP":{"Active":"","Profile":"","Target":"","Preview":"","Source":"","Stream":"","Server":"","User":"","Pass":"","Protocol":"","Port":"","ConnectionType":"","Verifycertificate":"","EncryptionMode":"","Overwrite":"","Destination":"","DeleteSource":"","Note":""}}

Parameter Details:

  • Active: Action status (0 for inactive, 1 for active).
  • Profile: Assign unique name for the Action.
  • Target: Assign profiles to specific users when multiple people share the database, or set the profile to 'default'. Only one profile can be set as the default.
  • Preview: Set '0' to process data in the background with no window displayed. Set '1' if user interaction is required, a window will open.
  • Source: Full path of the file to be printed.
  • Protocol: A set of rules governing the communication between the client and the server, in this case, FTP or SFTP.
  • Stream: A flow of data over a network connection upload or download.
  • Server: The computer or service that hosts files and manages requests from clients to upload or download those files.
  • User: The username required to authenticate with the server for access to files.
  • Pass: The password associated with the username to verify the identity of the user attempting to connect to the server.
  • Port: The network port number used for the connection. The default port for FTP is 21.
  • ConnectionType: Refers to the method of connecting to the server, such as active or passive mode.
  • VerifyCertificate: A setting that determines whether the client should check the server’s SSL/TLS certificate or FingerPrint to ensure it is valid and trusted.
  • EncryptionMode: The method used to encrypt the data being transferred, providing security during the file transfer process.
  • FingerPrint: is a unique hash of the server’s public key used by clients to verify the server's identity and ensure secure connections (for SFTP only).
  • Overwrite: A setting that dictates whether to replace an existing file on the server if a file with the same name is exists.
  • Destination: The target location on the server(Local or Remote) where files will be uploaded or from which files will be downloaded.
  • DeleteSource: Delete the source file after it has been uploaded or downloaded (use this option only if the FTP is the final action).
  • Note: Optional description with no functional impact.

Example:

upload file:

[
  {"FTP": {"Stream":"1", "Task":"0", "Profile":"U1", "Destination":"FTP/Archiv"}}
]

- Cloud

Automate the upload and download of files to an Cloud storage server

Parameters:

{"Cloud":{"Active":"","Profile":"","Target":"","Preview":"","Provider":"","Source":"","Stream":"","Pattern":"","Overwrite":"","Destination":"","Task":"","Note":""}}

Parameter Details:

  • Active: Action status (0 for inactive, 1 for active).
  • Profile: Assign unique name for the Action.
  • Target: Assign profiles to specific users when multiple people share the database, or set the profile to 'default'. Only one profile can be set as the default.
  • Preview: Set '0' to process data in the background with no window displayed. Set '1' if user interaction is required, a window will open.
  • Source: Full path of the file to be printed.
  • Provider: Cloud Provider 0 OneDrive
  • Stream: A flow of data over a network connection upload or download.
  • Pattern:
  • Overwrite: A setting that dictates whether to replace an existing file on the server if a file with the same name is exists.
  • Destination: The target location on the server(Local or Remote) where files will be uploaded or from which files will be downloaded.
  • Task: Copy or move
  • Note: Optional description with no functional impact.

Example:

upload file:

[
  {"Cloud": {"Stream":"1", "Task":"0", "Source":"c:\\SourceFolder", "Destination":"MyDrive/Archiv", }}
]

- Run

Automate the run a specified .exe file as a different user, passing custom command / Script (like powershell.exe or cmd.exe)

Parameters:

{"Run":{"Active":"","Profile":"","Target":"","Preview":"","Source":"","Program":"","Command":"","User":"","Pass":"","Domain":"","Note":""}}

Parameter Details:

  • Active: Action status (0 for inactive, 1 for active).
  • Profile: Assign unique name for the Action.
  • Target: Assign profiles to specific users when multiple people share the database, or set the profile to 'default'. Only one profile can be set as the default.
  • Preview: Set '0' to process data in the background with no window displayed. Set '1' if user interaction is required, a window will open.
  • Source: Full path of the file to be printed.
  • Program: The path to the executable e.g. PowerShell.exe or CMD.exe:
  • Command: Parameters, Script or Command to pass to the executable.
  • User: runas User. If you want to Run a *.exe automated as an administrator, the user must have the necessary permissions to bypass User Account Control (UAC). For example, on a Windows client, you need to activate the defualt Administrator account, as it has the required permissions.
  • Pass: user Password
  • Domain: The domain of the user if not needed.
  • Note: Optional description with no functional impact.

Example:

Run PowerShell script:

[
 {"Run": { "Preview": "0", "Program":"powershell.exe", "Command": "Write-Output \"The result of 1 + 1 is: \" (1 + 1)" }},
]