How to Customize Outreach Email Message Templates in MoneyPrinterV2
You can customize outreach email templates in MoneyPrinterV2 by editing the outreach_message_subject and outreach_message_body_file fields in your config.json file, then creating an HTML template that uses the {{COMPANY_NAME}} placeholder for dynamic content.
MoneyPrinterV2 automates cold outreach by sending personalized emails to scraped business contacts. Unlike systems with hardcoded messages, this tool loads your subject line and HTML body template from config.json at runtime, allowing you to tailor messaging without modifying Python source code. Follow this guide to customize outreach email message templates in MoneyPrinterV2 for your specific campaign needs.
How Outreach Template Configuration Works in MoneyPrinterV2
The system relies on two helper functions in src/config.py to retrieve your settings dynamically. The get_outreach_message_subject() function loads the subject line from config.json (lines 206‑214), while get_outreach_message_body_file() returns the path to your HTML template file (lines 216‑224).
The Outreach class in src/classes/Outreach.py calls these functions at lines 222‑223 to fetch the template configuration before sending emails. When processing each message, the code replaces the {{COMPANY_NAME}} placeholder with the scraped business name, then sends the HTML content via yagmail.
Step-by-Step Guide to Customize Outreach Email Message Templates
Update Your config.json Settings
Edit your config.json file to specify your custom subject and template path. If you don't have this file, copy the structure from config.example.json:
{
"outreach_message_subject": "🚀 Grow Your Business with {{COMPANY_NAME}}",
"outreach_message_body_file": "my_custom_message.html"
}
The outreach_message_subject field accepts any string and supports the {{COMPANY_NAME}} placeholder for dynamic insertion. The outreach_message_body_file should be a relative path from the repository root to your HTML template.
Create Your Custom HTML Template
Create the HTML file referenced in your configuration (e.g., my_custom_message.html in the project root):
<!DOCTYPE html>
<html>
<body style="font-family: Arial, sans-serif; line-height: 1.5;">
<p>Hello {{COMPANY_NAME}},</p>
<p>
I'm reaching out because I think your business could benefit from a
quick, free video audit. We specialize in turning local searches into
leads.
</p>
<p>
Would you be interested in a 5‑minute call to see how we can help?
</p>
<p>Best regards,<br/>
Your Name<br/>
<a href="mailto:you@example.com">you@example.com</a></p>
</body>
</html>
Use the {{COMPANY_NAME}} placeholder anywhere you want the scraped business name to appear. The HTML is passed directly to yagmail, so you can include inline styles, links, and formatting.
Add Additional Dynamic Placeholders (Optional)
If you need variables beyond {{COMPANY_NAME}} (such as {{WEBSITE}} or {{LOCATION}}), you must modify the template loading logic in src/classes/Outreach.py. Locate the code that reads the HTML file (around lines 276‑281) and append additional replace() calls:
body = (
open(message_body, "r")
.read()
.replace("{{COMPANY_NAME}}", company_name)
.replace("{{WEBSITE}}", website)
.replace("{{LOCATION}}", location)
)
Ensure the variables (website, location) are available in the scope where this replacement occurs.
Key Source Files and Functions
Understanding these core components helps you troubleshoot template issues:
src/config.py– Containsget_outreach_message_subject()andget_outreach_message_body_file(), which parseconfig.jsonto retrieve your template settings.src/classes/Outreach.py– TheOutreachclass fetches these values at lines 222‑223, reads the HTML template, substitutes{{COMPANY_NAME}}, and sends the email viayagmail.config.example.json– Provides a reference implementation showing the default structure foroutreach_message_subjectandoutreach_message_body_file.
Summary
- Customize outreach email message templates in MoneyPrinterV2 by editing
outreach_message_subjectandoutreach_message_body_fileinconfig.json. - Create an HTML file with the
{{COMPANY_NAME}}placeholder for dynamic business name insertion. - The
Outreachclass loads these settings fromsrc/config.pyand processes the template at runtime. - For additional placeholders, modify the string replacement logic in
src/classes/Outreach.py.
Frequently Asked Questions
Where are the email templates stored in MoneyPrinterV2?
Email templates are stored as external HTML files that you create and reference. The path to your template is defined by the outreach_message_body_file value in config.json. There is no built-in template directory; you can place the HTML file anywhere in the project directory as long as the relative path is correct.
Can I use multiple placeholders in my outreach templates?
Yes, but only {{COMPANY_NAME}} is supported by default. If you want to use additional placeholders like {{WEBSITE}} or {{INDUSTRY}}, you must edit src/classes/Outreach.py and add extra .replace() calls after the HTML file is read. Ensure the additional data fields are available in the method scope when the replacements occur.
How do I add new dynamic variables like {{WEBSITE}} to my templates?
Locate the template processing code in src/classes/Outreach.py around lines 276‑281. After reading the HTML file content, chain additional replace() methods for each new variable. For example, add .replace("{{WEBSITE}}", website) where website is a variable containing the target website URL. You may also need to modify the scraping logic to capture this data if it isn't already available.
Is the email body sent as HTML or plain text?
The email body is sent as HTML. The outreach_message_body_file you specify must point to an HTML file, and the content is passed directly to yagmail without conversion. This allows you to use inline CSS, formatting, links, and images. Ensure your HTML is properly formatted for email clients, as complex CSS may not render consistently across all platforms.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →