Spaces:
Sleeping
Sleeping
File size: 816 Bytes
c8fe359 8235662 a57dd2c 8235662 c8fe359 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import os
from simple_salesforce import Salesforce
def get_salesforce_connection():
# Load credentials from environment variables
sf_username = os.getenv('SF_USERNAME')
sf_password = os.getenv('SF_PASSWORD')
sf_token = os.getenv('SF_SECURITY_TOKEN')
# Salesforce connection details
#sf = Salesforce(username='[email protected]', password='Sati@1020', security_token='sSSjyhInIsUohKpG8sHzty2q')
# Ensure the credentials are available
if not sf_username or not sf_password or not sf_token:
raise ValueError("Salesforce credentials are missing from environment variables.")
# Connect to Salesforce
sf = Salesforce(username=sf_username, password=sf_password, security_token=sf_token)
print("Connected to Salesforce successfully!")
return sf
|