Self Service Email - Rocketman-Tech/rcc GitHub Wiki
The Self Service Email tool generates a pre-filled email template that users can send via their email client. It automatically composes the email with specified recipients, subject, and body content. If an email client is not set up, the tool provides a fallback by saving the email as a plain text file for manual use.
Quick Start
To quickly compose and open an email, run the following command:
Example Command
rocketman SelfServiceEmail \
--to "[email protected]" \
--subject "Assistance Request" \
--body "Please provide details about your issue."
This example creates an email addressed to [email protected]
with the subject "Assistance Request" and the specified body content. The email will open in the user’s default email client.
Command Options
Required Parameters
--to [string]
Specifies the recipient's email address.
- Type: string
- Default: None
- Example:
rocketman SelfServiceEmail --to "[email protected]"
--subject [string]
Sets the subject of the email.
- Type: string
- Default: None
- Example:
rocketman SelfServiceEmail --subject "Assistance Request"
--body [string]
Defines the main content of the email.
- Type: string
- Default: None
- Example:
rocketman SelfServiceEmail --body "Please provide details about your issue."
Optional Parameters
--cc [string]
Specifies additional recipients to be copied on the email. Separate multiple addresses with commas.
- Type: string
- Default: None
- Example:
rocketman SelfServiceEmail --cc "[email protected],[email protected]"
--bcc [string]
Adds blind carbon copy recipients, whose addresses are hidden from other recipients. Separate multiple addresses with commas.
- Type: string
- Default: None
- Example:
rocketman SelfServiceEmail --bcc "[email protected]"
--simulate
Simulates the email generation process without opening the email client.
- Type: flag
- Default: False
- Example:
rocketman SelfServiceEmail --simulate
--domain [string]
Specifies the domain for settings in local or managed plists.
- Type: string
- Default:
tech.rocketman.selfservicemail
- Example:
rocketman SelfServiceEmail --domain "custom.domain.selfservicemail"
--clientId [string]
Jamf API Client ID for retrieving user or device information.
- Type: string
- Default: None
- Example:
rocketman SelfServiceEmail --clientId "YourClientID"
--clientSecret [string]
Jamf API Client Secret for authentication.
- Type: string
- Default: None
- Example:
rocketman SelfServiceEmail --clientSecret "YourClientSecret"
Advanced Usage Example
The following command creates an email with multiple recipients and additional information retrieved from Jamf API:
rocketman SelfServiceEmail \
--to "[email protected]" \
--cc "[email protected]" \
--bcc "[email protected]" \
--subject "Technical Support Needed" \
--body "Please assist with the following issue: ..." \
--clientId "YourClientID" \
--clientSecret "YourClientSecret"
If the user’s default email client is not configured or fails to open, the email will be saved as a plain text file in /tmp/EmailTemplate.txt
for manual use.
Important Notes
-
Fallback for Missing Email Client:
- If no email client is configured, the tool saves the email content as a text file. The file includes all recipients, subject, and body content, allowing users to manually copy and paste the details into another platform.
- The text file is saved to:
/tmp/EmailTemplate.txt
.
-
Jamf API Integration:
- If
--clientId
and--clientSecret
are provided, the tool retrieves user and device information from Jamf Pro to append additional context to the email body. - Information added includes the user's full name, computer model, Jamf Pro Record ID, and Trellix GUID (if available).
- If
-
Simulation Mode:
- Use the
--simulate
flag to validate configurations and view outputs without opening the email client.
- Use the
-
Platform Limitations:
- The tool relies on the
mailto
protocol to interact with the default email client, which may behave differently across platforms. Ensure the default email client is properly configured.
- The tool relies on the
Inspiration
Inspired by @emily's Jamf Nation Post: Sending Emails via JSS