0

I am new in react native.

My question is pretty simple: I need to change subject of email with a address of consultant. example: Vul uw vraag, naam en adres in{address}

Address is object, so how to make a strings from this : {activeUser.rentalUnit?.address.street} {activeUser.rentalUnit?.address.houseNumber}{activeUser.rentalUnit?.address.postCode} {activeUser.rentalUnit?.address.city} and to make with one variable which I will use in subject and body also. Thank you all :)

    const onSendMail = () => {
    Linking.openURL(
        `mailto:${activeUser.rentalUnit?.complex?.email || '[email protected]'}?subject=${Strings.Board.EmailSubject}&body=${Strings.Board.EmailText} ${
            activeUser.rentalUnit?.address?.street
        }  `,
    );
};

1 Answer 1

1

Do you mean you wanna concatenation the address string?

const onSendMail = () => {
 const subjectAddress = `${activeUser.rentalUnit?.address.street} ${activeUser.rentalUnit?.address.houseNumber}${activeUser.rentalUnit?.address.postCode} ${activeUser.rentalUnit?.address.city}`
    Linking.openURL(
        `mailto:${activeUser.rentalUnit?.complex?.email || '[email protected]'}?subject=${subjectAddress}&body=${Strings.Board.EmailText} ${
            subjectAddress
        }  `,
    );
};
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.