Archived Forum Post

Index of archived forum posts


ckEmail: Is there a way to update the replacement pattern

Mar 24 '15 at 12:40

I am writing a routine to loop through a data send some emails. In the email I want to place a call-back link with a md5 hash of the email address and record id. To do this, I want to utilize the .SetReplacePattern method of the email library. Is there a way to update or remove/add the replacement patter so that I can just use one email object?

While Not EOF
  hash - crypt.enc(email(x) + id(x))
  link = " + hash
  email.SetReplacePattern "~link", link
  email.addto person(x), email(x)
  mm.send email

Accepted Answer

Yes, if you call SetReplacePattern with a name that already exists, it will replace that named pattern with the new value. Unfortunately, there is no way to remove a replacement pattern once added. You would need to use a new email object instance.