mirror of
https://github.com/axllent/mailpit.git
synced 2025-08-15 20:13:16 +02:00
UI: Support for inline images using filenames instead of cid
Some historic email programs use the attachment filename instead of a reference cid for inline images (eg: Outlook).
This commit is contained in:
@@ -173,6 +173,12 @@ export default {
|
|||||||
new RegExp('cid:'+a.ContentID, 'g'),
|
new RegExp('cid:'+a.ContentID, 'g'),
|
||||||
window.location.origin+'/api/'+d.ID+'/part/'+a.PartID
|
window.location.origin+'/api/'+d.ID+'/part/'+a.PartID
|
||||||
);
|
);
|
||||||
|
} else if (a.FileName.match(/^[a-zA-Z\_\-\.]+$/)) {
|
||||||
|
// some old email clients use the filename
|
||||||
|
d.HTML = d.HTML.replace(
|
||||||
|
new RegExp('src=(\'|")'+a.FileName+'(\'|")', 'g'),
|
||||||
|
'src="'+window.location.origin+'/api/'+d.ID+'/part/'+a.PartID+'"'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -185,6 +191,12 @@ export default {
|
|||||||
new RegExp('cid:'+a.ContentID, 'g'),
|
new RegExp('cid:'+a.ContentID, 'g'),
|
||||||
window.location.origin+'/api/'+d.ID+'/part/'+a.PartID
|
window.location.origin+'/api/'+d.ID+'/part/'+a.PartID
|
||||||
);
|
);
|
||||||
|
} else if (a.FileName.match(/^[a-zA-Z\_\-\.]+$/)) {
|
||||||
|
// some old email clients use the filename
|
||||||
|
d.HTML = d.HTML.replace(
|
||||||
|
new RegExp('src=(\'|")'+a.FileName+'(\'|")', 'g'),
|
||||||
|
'src="'+window.location.origin+'/api/'+d.ID+'/part/'+a.PartID+'"'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user