• reeti bibhuti
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 8
    Replies
Hello,
I set up the JIT SSO configuration for communities and passing these attributes :
Contact.Email
Contact.LastName
User.Email
User.FederationIdentifier
User.LastName
User.ProfileId
User.Username
eduPersonPrincipalName
email
givenName
surname
uid
External users can log in and it also creates a new community user but for existing internal users. I am getting errors : 
https://abc.my.salesforce.com/_nc_external/identity/saml/SamlError?ErrorCode=5&ErrorDescription=Unable+to+create+user&ErrorDetails=Changing+User+Type+from+Standard+to+MSSC+Community+Portal+Login+User+is+not+allowed.+Select+a+different+profile.
 
Hi, My apex class is working fine in the sandbox but not firing email in production. I have scheduled job for the apex class in production and sandbox.
here is the code:

global class BirthdayCronJob implements Schedulable{    
      
      //mandatory function called by the Apex Scheduler  
      global void execute(SchedulableContext SC) {  
        sendmail(); // our main function that does the email sending  
      }//end execute()  
    
    
      public void sendMail()   
      {  
        //define variables       
         
        String BirthdayEmailTemplateName = 'Contact_Birthday_Reminder';  
        String debugMessage;  
        String[] toAddresses;  
    
        Integer DayOfEvent  = date.today().day();  
        Integer MonthOfEvent = date.today().month();  
    
    
        // build the Birthday list  
    
        //get the list of people with birthdays - this can justifiably come back empty, on a day when no contacts were born   
       // List<Id> BirthdayIdsList = getBirthdayEmailAddresses(MonthOfEvent,DayOfEvent);  
        
        Contact[] c = [SELECT Id, email, Birthdate, Receive_Birthday_Emails__c  
                FROM Contact   
                WHERE email <> '' AND   
                DAY_IN_MONTH(Birthdate) = : DayOfEvent   
                AND CALENDAR_MONTH(Birthdate) = : MonthOfEvent AND accountid in (select id from account where parentid='0011I00000tF1CfQAK')  
                ];
    
    
        //Set the templates  
        EmailTemplate birthdayTemplate = [select Id,Name,Subject,body from EmailTemplate where DeveloperName = :BirthdayEmailTemplateName];  
        
        //If we have a template, and we have a list of email addresses, then send the email  
       // if(birthdayTemplate != null && BirthdayIdsList.isEmpty() == false) 
        if(birthdayTemplate != null)  
        {  
        
          OrgWideEmailAddress[] owea = [select Id from OrgWideEmailAddress where Address = 'ari@rastegarproperty.com'];
  
           String[] bccAddresses = new String[] {'ari@rastegarproperty.com'};

            for(Contact recipient : c) {  
                            
                if (recipient.Receive_Birthday_Emails__c == true )  
                {  
                    Messaging.SingleEmailMessage birthdayMail = new Messaging.SingleEmailMessage();  
                     // mailToIds.add(recipient.Id);  // add to email contact array  
                     birthdayMail.setTargetObjectId(recipient.Id);
                     birthdayMail.setTemplateId(birthdayTemplate.Id);
                     birthdayMail.setBccAddresses(bccAddresses);
                    if ( owea.size() > 0 ) {
                        birthdayMail.setOrgWideEmailAddressId(owea.get(0).Id);
                     }
                      try {  
                        //Messaging.sendEmail(new Messaging.MassEmailMessage[] { birthdayMail });  
                        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { birthdayMail });
            
                      }catch(Exception e)  
                      {  
                        System.Debug(e);  
                      }  
          
                     
                } else {  
                  System.Debug('\n*******NO Recipient');  
                }  
                
            }  
              
 
          // Send the email  
         
        }  
        else  
        {  
          System.Debug('BirthdayCronJob:sendMail(): Either an email template could not be found, or no Contact has a birthday today');  
        }//end if  
            
     }//end sendMail()   
      
  }//end class BirthdayCronJob
Reeti Bibhuti 
RSS feed using jquery
I made lighting component for rss feed to show on Community home page. ThereI  have a jquery method and its very simple thing. $.ready(function(){

But looks like this method is firing twice. How to fix this.
Here is the code of auro component :

<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >
<ltng:require scripts="{!$Resource.jQuery}"
                  afterScriptsLoaded="{!c.loadJquery}" />
    
   <div id="RSSname" class="slds-page-header"></div>
    <div id="rssfeed" class="rssfeed"></div>
</aura:component>
First part of js file:
({
    loadJquery : function(component, event, helper) {
          
        jQuery(document).ready(function(){

Or is there any way to see CNN/BBC news feed on the community home page?
Hello,
I set up the JIT SSO configuration for communities and passing these attributes :
Contact.Email
Contact.LastName
User.Email
User.FederationIdentifier
User.LastName
User.ProfileId
User.Username
eduPersonPrincipalName
email
givenName
surname
uid
External users can log in and it also creates a new community user but for existing internal users. I am getting errors : 
https://abc.my.salesforce.com/_nc_external/identity/saml/SamlError?ErrorCode=5&ErrorDescription=Unable+to+create+user&ErrorDetails=Changing+User+Type+from+Standard+to+MSSC+Community+Portal+Login+User+is+not+allowed.+Select+a+different+profile.