Hey there,

I'm sending mails using Kdyby/Command for CRON. Inside the mail, I need to build links. Here comes the problem: each user has its own mail language settings and I need to build the links accordingly.

I'm too lazy to write {link //Homepage:default 'locale' => $userLang} everywhere (also, I'm not the one who creates mail templates and it's possible the other programmer can forget about this). Is there a clean way to set locale in CliPresenter? Or should I create my own {link} macro?

EDIT: I'm asking about the locale because I use persistent atribute $locale in BasePresenter. That's what lead me to the idea.

Interesting question! I've just spent half an hour figuring it out and I still have no clue :)

You already have to remember to write // at the beginning of every link, locale => $ocale is the same deal imho. Overloading the link macro might not be a bad idea.

I have opted for the locale => $locale, as it is the easiest solution. Usually, new mail template is created by copying old ones and editing the body. This shouldn't be a problem then.


You must first log in to participate in this discussion