예제 #1
0
def SendConfirmationEmail(objHere, strEmailId):
    if not strEmailId:
        objMember = GetCurrentMember(objHere)
        for objEmailAddress in objMember.objectValues("E3EmailAddress"):
            if not objEmailAddress.Confirmed:
                objEmailAddress.RequestConfirmation()
                SetMessage(objHere, '', 'Confirmation request sent to %s' % objEmailAddress.EmailAddress)
    else:
        objEmailAddress = SearchOne(objHere, 'E3EmailAddress', 'id', strEmailId)
        if objEmailAddress:
            objEmailAddress.RequestConfirmation()
            SetMessage(objHere, '', 'Confirmation request sent to %s' % objEmailAddress.EmailAddress)
        else:
            print "Email address not found: ", strEmailId
예제 #2
0
파일: E3Profiles.py 프로젝트: CoachCoen/ECL
def EditProfileForm(objHere):
    objMember = GetCurrentMember(objHere)

    lstEmailAddresses = []
    for objEmailAddress in objMember.objectValues('E3EmailAddress'):
        lstEmailAddresses.append(objEmailAddress.EmailAddress)
    lstEmailAddresses.sort()

    lstPrivacyOptions = ('Hide', 'Members only', 'Show to all')

    lstForm = []

    lstForm.append(Fieldset('Your Privacy Settings', None,
        Paragraph(
            PureText('For some of your details you can choose whether they will be visible to everyone or to fellow list members only')),
        Paragraph(
            PureText('All the other details you enter below will automatically be visible to everyone'))))

    lstForm.append(Fieldset('Featured List Member', None,
        Paragraph(
            PureText('Once a day the system chooses a list member to feature on the website. For an example see the right hand side of this page')),
        Paragraph(
            PureText('You may be featured if you have entered your name, tag line and comments for potential clients. Your full name must be made visible to all if you want to be featured')),
        Paragraph(
            TextControl('Name', 'Name')),
        Paragraph(
            RadioButtonControl('Full name', 'ShowFullName', lstPrivacyOptions)),
        Paragraph(
            TextControl('Tagline or title', 'TagLine', strComments = '(for instance "Executive Coaching", "Coaching to be your best")')),
        Paragraph(
            TextArea('Comments for potential clients', 'CommercialComments'))))

    lstForm.append(Fieldset('Personal Details', None,
        Paragraph(
            SelectControl('Country', 'Country', cnCountryNames)),
        Paragraph(
            RadioButtonControl('Show country', 'ShowCountry', lstPrivacyOptions)),
        Paragraph(
            TextControl('Location', 'Location')),
        Paragraph(
            RadioButtonControl('Show location', 'ShowLocation', lstPrivacyOptions)),
        Paragraph(
            TextControl('Postcode', 'Postcode')),
        Paragraph(
            RadioButtonControl('Show postcode', 'ShowPostcode', lstPrivacyOptions)),
        Paragraph(
            TextArea('Languages', 'Languages'))))

    lstForm.append(Fieldset('Contact Details', None,
        Paragraph(
            SelectControl('Contact email address', 'ContactEmailAddress', lstEmailAddresses, strComments = 'Email addresses are entered on the <a href="/MyECL">MyECL page</a>')),
        Paragraph(
            RadioButtonControl('Show email address', 'ShowEmailAddress', lstPrivacyOptions)),
        Paragraph(
            TextControl('Website address', 'WebsiteAddress')),
        Paragraph(
            TextControl('Phone', 'PhoneNumber')),
        Paragraph(
            RadioButtonControl('Show phone number', 'ShowPhoneNumber', lstPrivacyOptions))))

    lstForm.append(Fieldset('Coaching communities', None,
            Paragraph(
                PureText("I am the host of the following coaching group (chapter, circle, network, etc):")),
            Paragraph(
                TextControl('Group name', 'HostOfChapter'))))

    lstForm.append(Fieldset('Personal comments', None,
            Paragraph(
                TextArea('Personal comments', 'CommunityComments')),
            Paragraph(
                RadioButtonControl('Show comments', 'ShowCommunityComments', lstPrivacyOptions))))

    lstForm.append(Fieldset('Your business or professional profile', None,
            Paragraph(
                TextArea('Biography', 'Biography')),
            Paragraph(
                RadioButtonControl('Show biography', 'ShowBiography', lstPrivacyOptions)),
            Paragraph(
                TextArea('Testimonials', 'Testimonials'))))
    lstForm.append(Fieldset('Save your changes', None,
            Paragraph(
                SubmitControl('Update profile'))))

    dictMemberProfile = LoadDataFromObject(objMember, cnProfileFieldNames)
    strForm = CreateForm(objHere, lstForm, dictMemberProfile, "", {'Action': 'UpdateProfile'})
#    strForm = unicode(strForm, 'utf-8', 'replace')
#    strResult = "Testing"
    return strForm