Dynamic Employee Images Not Loading in Notification Templates

Problem

I’m creating birthday notification emails in ERPNext. The notification template works fine, but employee images are not loading dynamically.

What Works

html

<!-- Hard-coded path works -->
<img src="/files/IMG-20250313-WA0039.jpg" alt="Employee" />

What Doesn’t Work

html

<!-- This returns NULL -->
{% if doc.image %}
    <img src="{{ doc.image }}" alt="{{ doc.employee_name }}" />
{% endif %}

Setup

  • Document Type: Employee
  • Event: Birthday notification
  • Issue: {{ doc.image }} returns NULL even though employees have images in their records

Question

How do I dynamically load different employee images in ERPNext notification templates? Each employee has a different image URL.

What I Need

A way to get each employee’s image path dynamically instead of hard-coding it.

Any solutions or suggestions would be helpful!

Thanks!