function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Terence VibanTerence Viban 

Passing parameters from email template to component

 Problem: In the email template, i am using a component which expects the account Id. This is assigned to a property on the Controller. The account Id never gets passed to the controller. On the UI "Set Test and Verify Merge Fields" everything works perfectly fine.

<messaging:emailTemplate subject="Quote" recipientType="Contact" relatedToType="Account">
<messaging:htmlEmailBody >
        <c:KoreanTest acct="{!relatedTo.Id}" />

<apex:component controller="CtrKoreanTest" access="global">
<apex:attribute name="acct" type="String" description="Placeholder" assignTo="{!acctId}"/>
<table width="100%">
        <td class="headelements" ><div style="width: 200px;"><img src="{!URLFOR($Resource.Yogiyo_Logo)}" /></div></td>
        <td class="headelements" style="font-weight: bold; font-size: 17px;">요기요 서비스 등록 신청서</td>
        <td class="headelements">
            <div><span style="width: 10px;">담당자</span> : {!accountWrapper.Name} </div>
            <div><span style="width: 10px;">연락처</span> : {!accountWrapper.Company_Number__c}</div>
<br />

public without sharing class CtrKoreanTest {
    public String acctId { get; set; }
    public CtrKoreanTest() {

   public ClsAccountWrapper getAccountWrapper(){
        ClsAccountWrapper accountWrapper;
        if(acctId != null){
            acct = [SELECT Id, Name, Company_Number__c FROM Account WHERE Id =: acctId];
            accountWrapper = new ClsAccountWrapper(acct);
        return accountWrapper;

ClsAccountWrapper is a simple wrapper class

I will very much appreciate any ideas what to look for. 
Vishnu VaishnavVishnu Vaishnav
can you put your whole will helpfull for me to solve out..