I would like to ask if there is any way to modify the subject of mail that is accessed by email worker before forwarding it. I tried for last 4 days, every solution i came up with threw me a error.
When i tried to modify he headers. It trew me error (i dont have the exact log), but it meant that i cannot modify the original headers.
When i tried to forward other message, i created exactly same message in which i could change the headers with same structure. It threw me this error
“name”: “TypeError”,
“message”: “Illegal invocation”,
Then i tried to see how .forward() func is structered so i could recreate it. I wasnt able to find what it does or how its structured (I think its due to security).
in my project i need to change it from
subject: “[subject]”
to
subject: “[custom text], mail: [mail to which it was sent], subject: [subject]”
[subject] is the original subject
[mail to which it was sent] is mail in receiving mail, due to me having the worker linked with all adresses.
My codes are dead end, because cloudflare is blocking the actions. If you think they could help i can post it here.
I understand that for privacy/security reason it is blocked to modify the headers, but if its for my own purpuse, there should be way to modify them or atleast modify the subject.
If you got any clue how it coud be done it would help.
Thank you…