Dynamically fill mail from Lightbox data.

Hi everybody, I’ve tried to find answer to my questions bu I was unable to do it so I decided to ask exactly what I’m trying to do.
What I got:
*A Dynamic Page with a repeater on it connected with a Collection.
*On each repeated box there’s a bunch of txts and a button connected to a lighbox.
*In this Lightbox there a contact form and another bunch of texts.
What I’m trying to do:
- Fill dynamically the texts with the data from the box in the repeater where the click come from.
- When the customer filled the data in the contact form and click the “send” button, I want to fill the email with data from the contact form AND the texts previously filled with data from the repeater.

There’s a way to do this things?

Thanks in advance!

no answer or link where I can take some hints?

Lmk if you found an answer i have the same problem

I’ve found a solution that work pretty well:

on the show DB page with 4 db connections, one image from the DB and 3 repeater connected each to one connection I’ve put this code:

// For full API documentation, including code examples, visit http://wix.to/94BuAAs

import wixWindow from 'wix-window';
import {session} from 'wix-storage';

 export function button6_click(event,$w) {
    session.setItem('Mesi',$w('#lblMesi2').value);
    session.setItem('Km',$w('#lblKm2').value);
    session.setItem('Anticipo',$w('#lblAnticipo2').value);
    session.setItem('Canone',$w('#lblCanone2').value);
    session.setItem('Modello',$w('#lblModello2').value);
    }

 export function button7_click(event,$w) {
    session.setItem('Mesi',$w('#lblMesi4').value);
    session.setItem('Km',$w('#lblKm4').value);
    session.setItem('Anticipo',$w('#lblAnticipo4').value);
    session.setItem('Canone',$w('#lblCanone4').value);
    session.setItem('Modello',$w('#lblModello4').value);
    }

 export function button8_click(event,$w) {
    session.setItem('Mesi',$w('#lblMesi6').value);
    session.setItem('Km',$w('#lblKm6').value);
    session.setItem('Anticipo',$w('#lblAnticipo6').value);
    session.setItem('Canone',$w('#lblCanone6').value);
    session.setItem('Modello',$w('#lblModello6').value);
    }

 export function button9_click(event,$w) {
    session.setItem('Mesi',$w('#text23').value);
    session.setItem('Km',$w('#text52').value);
    session.setItem('Anticipo',$w('#text50').value);
    session.setItem('Canone',$w('#text26').value);
    session.setItem('Modello',$w('#text22').value);
    }
 //TODO: write your page related code here...
$w.onReady(function () {

 let dataObj
    $w("#button6").onClick( (event, $w) => {
        session.setItem('Mesi',$w('#lblMesi2').text);
        session.setItem('Km',$w('#lblKm2').text);
        session.setItem('Anticipo',$w('#lblAnticipo2').text);
        session.setItem('Canone',$w('#lblCanone2').text);
        session.setItem('Modello',$w('#lblModello2').text);
 // console.log(session.getItem('Anticipo'));
         wixWindow.openLightbox("Richiesta Info Precompilata", );
    });
    $w("#button7").onClick( (event, $w) => {
        session.setItem('Mesi',$w('#lblMesi4').text);
        session.setItem('Km',$w('#lblKm4').text);
        session.setItem('Anticipo',$w('#lblAnticipo4').text);
        session.setItem('Canone',$w('#lblCanone4').text);
        session.setItem('Modello',$w('#lblModello4').text);
 // console.log(session.getItem('Anticipo'));
         wixWindow.openLightbox("Richiesta Info Precompilata", );
    });
    $w("#button8").onClick( (event, $w) => {
        session.setItem('Mesi',$w('#lblMesi6').text);
        session.setItem('Km',$w('#lblKm6').text);
        session.setItem('Anticipo',$w('#lblAnticipo6').text);
        session.setItem('Canone',$w('#lblCanone6').text);
        session.setItem('Modello',$w('#lblModello6').text);
 // console.log(session.getItem('Anticipo'));
         wixWindow.openLightbox("Richiesta Info Precompilata", );
    });
    $w("#button9").onClick( (event, $w) => {
        session.setItem('Mesi',$w('#text23').text);
        session.setItem('Km',$w('#text52').text);
        session.setItem('Anticipo',$w('#text50').text);
        session.setItem('Canone',$w('#text26').text);
        session.setItem('Modello',$w('#text22').text);
 // console.log(session.getItem('Anticipo'));
         wixWindow.openLightbox("Richiesta Info Precompilata", );
    });

});

this because I’ve 4 DB connection with 4 different selection and each have to be handled separately.

that code will put the data in a session variable each called differently available to the Lightbox connect form that is called from the line

wixWindow.openLightbox("Richiesta Info Precompilata", );

on the Lightbox page I’ve this code:

// For full API documentation, including code examples, visit http://wix.to/94BuAAs
import {lightbox} from 'wix-window';
import {session} from 'wix-storage';

$w.onReady(function () 
{
    $w('#txtMESSAGGIO').value = "\n\n\nModello :" + session.getItem('Modello');
    $w('#txtMESSAGGIO').value = $w('#txtMESSAGGIO').value + "\nDurata : " + session.getItem('Mesi') + " mesi";
    $w('#txtMESSAGGIO').value = $w('#txtMESSAGGIO').value + "\nChilometraggio : " + session.getItem('Km') + " Km";
    $w('#txtMESSAGGIO').value = $w('#txtMESSAGGIO').value + "\nAnticipo : " + session.getItem('Anticipo') + " €";
    $w('#txtMESSAGGIO').value = $w('#txtMESSAGGIO').value + "\nCanone : " + session.getItem('Canone') + " €";
});

where #txtMESSAGGIO is the area that have to be filled with data inside the contact form and each line put a label and the fetched data from the session variable and the “new line” (/n)code in from of each label.

The Lightbox will be still available to edit with all the data fetched from each single button pressed in the repeater.