• Zachary Walton
  • NEWBIE
  • 35 Points
  • Member since 2017
  • Software Engineer
  • Zachary Walton Consulting


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
Hi experts, i'm trying to develop a trigger that send an email when a record is created with a condition, but when I insert the record in the object i'm not receive the email.

This is my code: 
trigger Fila on Fila__c (before insert) {

	 	
    	List<Messaging.SingleEmailMessage> mails =  new List<Messaging.SingleEmailMessage>();
  
    	for(Fila__c fila : Trigger.New) {
            
            if(fila.Posicao__c == 2){
            Messaging.SingleEmailMessage mail =  new Messaging.SingleEmailMessage();
	  		//  list of people who should get the email
          	List<String> sendTo = new List<String>();
          
          	sendTo.add('henriquelive19@gmail.com');
          	mail.setToAddresses(sendTo);
        
          	// Set email is sent from
          	mail.setReplyTo('henrique@mobiaplicativos.com.br');
          	mail.setSenderDisplayName('henrique');
        
          	// Set email contents
          	mail.setSubject('URGENT BUSINESS PROPOSAL');
          	String body = 'Dear ';
          	body += 'Email Body.';
          
          	mail.setHtmlBody(body);
        
          	// Add your email to the master list
          	mails.add(mail);
            
            try
             {
               Messaging.sendEmail(mails);	
             }
            catch (Exception e) {
               System.debug('erro' + e);
             }
      	}
  	}
}

my test class is working, but the trigger are not working, anybody can help me in this case?
Challenge Not yet complete... here's what's wrong: 
You haven't installed the DreamHouse app package.
Hi experts, i'm trying to develop a trigger that send an email when a record is created with a condition, but when I insert the record in the object i'm not receive the email.

This is my code: 
trigger Fila on Fila__c (before insert) {

	 	
    	List<Messaging.SingleEmailMessage> mails =  new List<Messaging.SingleEmailMessage>();
  
    	for(Fila__c fila : Trigger.New) {
            
            if(fila.Posicao__c == 2){
            Messaging.SingleEmailMessage mail =  new Messaging.SingleEmailMessage();
	  		//  list of people who should get the email
          	List<String> sendTo = new List<String>();
          
          	sendTo.add('henriquelive19@gmail.com');
          	mail.setToAddresses(sendTo);
        
          	// Set email is sent from
          	mail.setReplyTo('henrique@mobiaplicativos.com.br');
          	mail.setSenderDisplayName('henrique');
        
          	// Set email contents
          	mail.setSubject('URGENT BUSINESS PROPOSAL');
          	String body = 'Dear ';
          	body += 'Email Body.';
          
          	mail.setHtmlBody(body);
        
          	// Add your email to the master list
          	mails.add(mail);
            
            try
             {
               Messaging.sendEmail(mails);	
             }
            catch (Exception e) {
               System.debug('erro' + e);
             }
      	}
  	}
}

my test class is working, but the trigger are not working, anybody can help me in this case?
 Why add a bunch of slds classes for a few features instead of make a custom class with the features I want.  Is there a reason for adding
<div class="slds-box slds-p-around_small slds-m-around_small">
  <!-- Stuff in Container -->
</div>
to a container div instead of making a custom class
<div class="container">
   <!-- Stuff in Container -->
</div>
and adding the css features I specifically want?  I made two similary looking forms one with slds only and one with custom classes and it seems easier to see what is going on to inspect one class and check the css styles instead of inspecting multiple slds classes to find the slds styles. What is best practice?
  • January 31, 2018
  • Like
  • 0
How to we test lightning components? do we need to create test class as with Apex classes?

Do we need to have 75% tested lightning components? How to move them to Production?

Do lightning components be counted against Governor llimits ?