Jump to content

Domain ID variable for email templates


Santiago Botto

Recommended Posts

Hi! I know that someone previously asked this here but I'm not able to submit replies there.

The only answer that question got was to try {$domain_id}, but that variable does not exist (at least, not in the scope of a domain's email template).

Does anyone know how to get the ID of a domain from within an email template? The value is at column id from table tbldomains.

Thanks!

Link to comment
Share on other sites

On 19/10/2019 at 19:17, Santiago Botto said:

The only answer that question got was to try {$domain_id}, but that variable does not exist (at least, not in the scope of a domain's email template).

have you checked that by testing it? just because it isn't listed in the merge field list at the bottom of the template, doesn't mean that it doesn't exist - that's not a complete list!

3JPdPVe.png

the above is from the "Expired Domain Notice" email template and $domain_id clearly exists and contains the correct ID value for that domain.

On 19/10/2019 at 19:17, Santiago Botto said:

Does anyone know how to get the ID of a domain from within an email template? The value is at column id from table tbldomains.

note I would expect $domain_id to only exist in Domain Type email templates... if you're searching for the domain ID value in another email template type, then you may have to query the db based on the variables that you do have access to in that template.

Link to comment
Share on other sites

7 hours ago, Kian said:

Use EmailPreSend to load domain IDs from tbldomains with a query then declare {$domain_id} custom variable so that it's equal to your array.

Yes, I think that's my only choice... Thanks!

 

 

2 hours ago, brian! said:

have you checked that by testing it? just because it isn't listed in the merge field list at the bottom of the template, doesn't mean that it doesn't exist - that's not a complete list!

3JPdPVe.png

the above is from the "Expired Domain Notice" email template and $domain_id clearly exists and contains the correct ID value for that domain.

note I would expect $domain_id to only exist in Domain Type email templates... if you're searching for the domain ID value in another email template type, then you may have to query the db based on the variables that you do have access to in that template.

Yes, I tested the existence of variable $domain_id by sending a Domain Type email with some text and hat variable properly formatted, that's why I clarified that it does "not exist (at least, not in the scope of a domain's email template)" since I'm able to get it from other areas, as you show from the output of Smarty's debug window.

 

If anyone has a way of getting $domain_id on the scope of a domain's email template without the need for EmailPreSend, it would be greatly appreciated! 

Link to comment
Share on other sites

17 hours ago, Santiago Botto said:

If anyone has a way of getting $domain_id on the scope of a domain's email template without the need for EmailPreSend, it would be greatly appreciated! 

i'm confused - the above debug window shows that, in these domain templates, you can access the variable via Smarty in the email template itself... 😕

so I guess that we've reached the stage where we need to ask - what you want to do with this domain ID value?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated