Shyamal Parikh
Shyamal Parikh

Reputation: 3068

DateTime formatting in Email Template

Is it possible for a ISO datetime to be converted to local format when the receiver opens a mail. That too in a specified format?

Or there is no option except for converting to user specific time difference server side?

Upvotes: 1

Views: 590

Answers (1)

Peaceand
Peaceand

Reputation: 296

I don't think there's any way of manipulating a datetime within the mail client - and if there is, it's unlikely that it'll work on all of them. The vast majority will strip JavaScript so we can't use that.

The only way I can think of (and it's not a good way) would be to make the date in the email an image which is loaded from a server. Then that server can do a geoip lookup and return an image of the desired datetime in the time zone of the IP address.

This way the email client would think it's just another image, and (providing images are downloaded) the date would appear.

However, it's a very dirty way of doing it, so I think the sensible answer is No unfortunately.

If you already know the time zones your recipients are in, adding the date serverside is the best option.

Upvotes: 1

Related Questions