Santiago Botto Posted October 19, 2019 Share Posted October 19, 2019 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! 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted October 21, 2019 Share Posted October 21, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 21, 2019 Share Posted October 21, 2019 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! 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. 0 Quote Link to comment Share on other sites More sharing options...
Santiago Botto Posted October 21, 2019 Author Share Posted October 21, 2019 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! 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! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 22, 2019 Share Posted October 22, 2019 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? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.