0

I am getting a controller error when i am trying to add a visualforce component to my email template, im struggling to debug why i'm getting the error?

Error: Unknown constructor 'outboundEmails.outboundEmails()'

This is the line in the email template i've added but i can't save because of the error:

<c:EmailPassRegistrationList oppId="{!relatedTo.Id}" /> 

This links to the component:

<apex:component allowDML="true" controller="outboundEmails" access="global"> 

<apex:attribute name="OppId" type="String" description="the opportunity ID" assignTo="{!opportunityId}" />

<apex:dataTable value="{!listOfPassRegistrations}" var="pb" id="passRegTable"  style="margin: 0 auto; border-bottom: thin dotted  red; width: 95%; font-size: 16px;  color: red; font-family: Century Gothic;  text-align: center; border-bottom: thin solid #fff319;">
    <apex:column value="{!pb.Name}" headerValue="Name" styleClass="table2" style="font-size: 14px;  font-family: Century Gothic;  text-align: center; color: black;"/>
</apex:dataTable>

listOfPassRegistrations includes:

    public List<CXT_Pass_Registration__c> getlistOfPassRegistrations(){
    List<CXT_Pass_Registration__c> passRegs = [SELECT Id, Name
                                               FROM CXT_Pass_Registration__c 
                                               WHERE CXT_Opportunity_Name__c =: opportunityId 
                                               )];
    return passRegs;
}

the controller in the that class is:

public outboundEmails(ApexPages.StandardSetController controller) {

    EmailTemplate ET = new EmailTemplate();
    selected = false;
    lstPreviousEmails = '';
    oppoList = new List<Opportunity>();
    emailIds = new Set<String>();
    emailPreviousIds = new Set<String>();

    oppIds = '';

    mapEmailTemplate = new Map<Id,EmailTemplate>();
    for(Opportunity opp: (List<Opportunity>)controller.getSelected()){
        oppoList.add(opp);
        oppIds = oppIds+opp.Id+';';
    }
}

any help on this would be greatly appreciated as this is going to be the most important part of this email.

0

Can you post your complete component and controller code? It's a little hard to figure out what's going on.

However, I think you need to remove the StandardSetController argument from your constructor. Most examples I've seen use the default no-argument constructor, and StandardSetController isn't going to work here anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.