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.

2 Answers 2

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.

0

As I can see your vf component code, there is no standard controller. You need to use no argument constructor like outboundEmails() instead of ApexPages.StandardSetController. hope this will help.

1
  • Just so you know Akhtar, this is a four year old question and the person asking it has probably moved on to other things
    – Kasper
    Jan 17, 2022 at 18:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .